(function($){ 'use strict'; if(typeof wpcf7==='undefined'||wpcf7===null){ return; } wpcf7=$.extend({ cached: 0, inputs: [] }, wpcf7); $(function(){ wpcf7.supportHtml5=(function(){ var features={}; var input=document.createElement('input'); features.placeholder='placeholder' in input; var inputTypes=[ 'email', 'url', 'tel', 'number', 'range', 'date' ]; $.each(inputTypes, function(index, value){ input.setAttribute('type', value); features[ value ]=input.type!=='text'; }); return features; })(); $('div.wpcf7 > form').each(function(){ var $form=$(this); wpcf7.initForm($form); if(wpcf7.cached){ wpcf7.refill($form); }}); }); wpcf7.getId=function(form){ return parseInt($('input[name="_wpcf7"]', form).val(), 10); }; wpcf7.initForm=function(form){ var $form=$(form); $form.submit(function(event){ if(typeof window.FormData!=='function'){ return; } wpcf7.submit($form); event.preventDefault(); }); $('.wpcf7-submit', $form).after(''); wpcf7.toggleSubmit($form); $form.on('click', '.wpcf7-acceptance', function(){ wpcf7.toggleSubmit($form); }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function(){ var name=$(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false); }); $('.wpcf7-list-item.has-free-text', $form).each(function(){ var $freetext=$(':input.wpcf7-free-text', this); var $wrap=$(this).closest('.wpcf7-form-control'); if($(':checkbox, :radio', this).is(':checked')){ $freetext.prop('disabled', false); }else{ $freetext.prop('disabled', true); } $wrap.on('change', ':checkbox, :radio', function(){ var $cb=$('.has-free-text', $wrap).find(':checkbox, :radio'); if($cb.is(':checked')){ $freetext.prop('disabled', false).focus(); }else{ $freetext.prop('disabled', true); }}); }); if(! wpcf7.supportHtml5.placeholder){ $('[placeholder]', $form).each(function(){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function(){ if($(this).hasClass('placeheld')){ $(this).val('').removeClass('placeheld'); }}); $(this).blur(function(){ if(''===$(this).val()){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); }}); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.date){ $form.find('input.wpcf7-date[type="date"]').each(function(){ $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.number){ $form.find('input.wpcf7-number[type="number"]').each(function(){ $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }); }); } $('.wpcf7-character-count', $form).each(function(){ var $count=$(this); var name=$count.attr('data-target-name'); var down=$count.hasClass('down'); var starting=parseInt($count.attr('data-starting-value'), 10); var maximum=parseInt($count.attr('data-maximum-value'), 10); var minimum=parseInt($count.attr('data-minimum-value'), 10); var updateCount=function(target){ var $target=$(target); var length=$target.val().length; var count=down ? starting - length:length; $count.attr('data-current-value', count); $count.text(count); if(maximum&&maximum < length){ $count.addClass('too-long'); }else{ $count.removeClass('too-long'); } if(minimum&&length < minimum){ $count.addClass('too-short'); }else{ $count.removeClass('too-short'); }}; $(':input[name="' + name + '"]', $form).each(function(){ updateCount(this); $(this).keyup(function(){ updateCount(this); }); }); }); $form.on('change', '.wpcf7-validates-as-url', function(){ var val=$.trim($(this).val()); if(val && ! val.match(/^[a-z][a-z0-9.+-]*:/i) && -1!==val.indexOf('.')){ val=val.replace(/^\/+/, ''); val='http://' + val; } $(this).val(val); }); }; wpcf7.submit=function(form){ if(typeof window.FormData!=='function'){ return; } var $form=$(form); $('.ajax-loader', $form).addClass('is-active'); $('[placeholder].placeheld', $form).each(function(i, n){ $(n).val(''); }); wpcf7.clearResponse($form); var formData=new FormData($form.get(0)); var detail={ id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field){ if('_wpcf7'==field.name){ detail.contactFormId=field.value; }else if('_wpcf7_version'==field.name){ detail.pluginVersion=field.value; }else if('_wpcf7_locale'==field.name){ detail.contactFormLocale=field.value; }else if('_wpcf7_unit_tag'==field.name){ detail.unitTag=field.value; }else if('_wpcf7_container_post'==field.name){ detail.containerPostId=field.value; }else if(field.name.match(/^_wpcf7_\w+_free_text_/)){ var owner=field.name.replace(/^_wpcf7_\w+_free_text_/, ''); detail.inputs.push({ name: owner + '-free-text', value: field.value }); }else if(field.name.match(/^_/)){ }else{ detail.inputs.push(field); }}); wpcf7.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess=function(data, status, xhr, $form){ detail.id=$(data.into).attr('id'); detail.status=data.status; detail.apiResponse=data; var $message=$('.wpcf7-response-output', $form); switch(data.status){ case 'validation_failed': $.each(data.invalidFields, function(i, n){ $(n.into, $form).each(function(){ wpcf7.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('[aria-invalid]', this).attr('aria-invalid', 'true'); }); }); $message.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); wpcf7.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': $message.addClass('wpcf7-acceptance-missing'); $form.addClass('unaccepted'); wpcf7.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': $message.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); $('[name="g-recaptcha-response"]', $form).each(function(){ if(''===$(this).val()){ var $recaptcha=$(this).closest('.wpcf7-form-control-wrap'); wpcf7.notValidTip($recaptcha, wpcf7.recaptcha.messages.empty); }}); wpcf7.triggerEvent(data.into, 'spam', detail); break; case 'aborted': $message.addClass('wpcf7-aborted'); $form.addClass('aborted'); wpcf7.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': $message.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); wpcf7.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': $message.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); wpcf7.triggerEvent(data.into, 'mailfailed', detail); break; default: var customStatusClass='custom-' + data.status.replace(/[^0-9a-z]+/i, '-'); $message.addClass('wpcf7-' + customStatusClass); $form.addClass(customStatusClass); } wpcf7.refill($form, data); wpcf7.triggerEvent(data.into, 'submit', detail); if('mail_sent'==data.status){ $form.each(function(){ this.reset(); }); } $form.find('[placeholder].placeheld').each(function(i, n){ $(n).val($(n).attr('placeholder')); }); $message.html('').append(data.message).slideDown('fast'); $message.attr('role', 'alert'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function(){ var $response=$(this); $response.html('').attr('role', '').append(data.message); if(data.invalidFields){ var $invalids=$(''); $.each(data.invalidFields, function(i, n){ if(n.idref){ var $li=$('
  • ').append($('').attr('href', '#' + n.idref).append(n.message)); }else{ var $li=$('
  • ').append(n.message); } $invalids.append($li); }); $response.append($invalids); } $response.attr('role', 'alert').focus(); }); }; $.ajax({ type: 'POST', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: false, contentType: false }).done(function(data, status, xhr){ ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); }).fail(function(xhr, status, error){ var $e=$('
    ').text(error.message); $form.after($e); }); }; wpcf7.triggerEvent=function(target, name, detail){ var $target=$(target); var event=new CustomEvent('wpcf7' + name, { bubbles: true, detail: detail }); $target.get(0).dispatchEvent(event); $target.trigger('wpcf7:' + name, detail); $target.trigger(name + '.wpcf7', detail); }; wpcf7.toggleSubmit=function(form, state){ var $form=$(form); var $submit=$('input:submit', $form); if(typeof state!=='undefined'){ $submit.prop('disabled', ! state); return; } if($form.hasClass('wpcf7-acceptance-as-validation')){ return; } $submit.prop('disabled', false); $('.wpcf7-acceptance', $form).each(function(){ var $span=$(this); var $input=$('input:checkbox', $span); if(! $span.hasClass('optional')){ if($span.hasClass('invert')&&$input.is(':checked') || ! $span.hasClass('invert')&&! $input.is(':checked')){ $submit.prop('disabled', true); return false; }} }); }; wpcf7.notValidTip=function(target, message){ var $target=$(target); $('.wpcf7-not-valid-tip', $target).remove(); $('') .text(message).appendTo($target); if($target.is('.use-floating-validation-tip *')){ var fadeOut=function(target){ $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function(){ $(this).css({ 'z-index': -100 }); }); }; $target.on('mouseover', '.wpcf7-not-valid-tip', function(){ fadeOut(this); }); $target.on('focus', ':input', function(){ fadeOut($('.wpcf7-not-valid-tip', $target)); }); }}; wpcf7.refill=function(form, data){ var $form=$(form); var refillCaptcha=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match=/([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[ 1 ]); }); }; var refillQuiz=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[ 0 ]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[ 1 ]); }); }; if(typeof data==='undefined'){ $.ajax({ type: 'GET', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/refill'), beforeSend: function(xhr){ var nonce=$form.find(':input[name="_wpnonce"]').val(); if(nonce){ xhr.setRequestHeader('X-WP-Nonce', nonce); }}, dataType: 'json' }).done(function(data, status, xhr){ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }}); }else{ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }} }; wpcf7.clearResponse=function(form){ var $form=$(form); $form.removeClass('invalid spam sent failed'); $form.siblings('.screen-reader-response').html('').attr('role', ''); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form) .hide().empty().removeAttr('role') .removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked'); }; wpcf7.apiSettings.getRoute=function(path){ var url=wpcf7.apiSettings.root; url=url.replace(wpcf7.apiSettings.namespace, wpcf7.apiSettings.namespace + path); return url; };})(jQuery); (function (){ if(typeof window.CustomEvent==="function") return false; function CustomEvent(event, params){ params=params||{ bubbles: false, cancelable: false, detail: undefined }; var evt=document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype=window.Event.prototype; window.CustomEvent=CustomEvent; })(); !function(e,t,n){function r(e,t){return typeof e===t}function o(){var e,t,n,o,i,s,a;for(var l in x)if(x.hasOwnProperty(l)){if(e=[],t=x[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;nd;d++)if(h=e[d],v=P.style[h],c(h,"-")&&(h=f(h)),P.style[h]!==n){if(i||r(o,"undefined"))return a(),"pfx"==t?h:!0;try{P.style[h]=o}catch(y){}if(P.style[h]!=v)return a(),"pfx"==t?h:!0}return a(),!1}function v(e,t,n,o,i){var s=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+N.join(s+" ")+s).split(" ");return r(t,"string")||r(t,"undefined")?h(a,t,o,i):(a=(e+" "+j.join(s+" ")+s).split(" "),d(a,t,n))}function g(e,t,r){return v(e,n,n,t,r)}var y=[],x=[],C={_version:"3.3.1",_config:{classPrefix:"lsow-",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){x.push({name:e,fn:t,options:n})},addAsyncTest:function(e){x.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=C,Modernizr=new Modernizr;var b=t.documentElement,S="svg"===b.nodeName.toLowerCase();S||!function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=x.elements;return"string"==typeof e?e.split(" "):e}function o(e,t){var n=x.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),x.elements=n+" "+e,c(t)}function i(e){var t=y[e[v]];return t||(t={},g++,e[v]=g,y[g]=t),t}function s(e,n,r){if(n||(n=t),u)return n.createElement(e);r||(r=i(n));var o;return o=r.cache[e]?r.cache[e].cloneNode():h.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!o.canHaveChildren||m.test(e)||o.tagUrn?o:r.frag.appendChild(o)}function a(e,n){if(e||(e=t),u)return e.createDocumentFragment();n=n||i(e);for(var o=n.frag.cloneNode(),s=0,a=r(),l=a.length;l>s;s++)o.createElement(a[s]);return o}function l(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return x.shivMethods?s(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(x,t.frag)}function c(e){e||(e=t);var r=i(e);return!x.shivCSS||f||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),u||l(e,r),e}var f,u,d="3.7.3",p=e.html5||{},m=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,h=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",g=0,y={};!function(){try{var e=t.createElement("a");e.innerHTML="",f="hidden"in e,u=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){f=!0,u=!0}}();var x={elements:p.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:d,shivCSS:p.shivCSS!==!1,supportsUnknownElements:u,shivMethods:p.shivMethods!==!1,type:"default",shivDocument:c,createElement:s,createDocumentFragment:a,addElements:o};e.html5=x,c(t),"object"==typeof module&&module.exports&&(module.exports=x)}("undefined"!=typeof e?e:this,t);var E=C._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];C._prefixes=E;var w="CSS"in e&&"supports"in e.CSS,_="supportsCSS"in e;Modernizr.addTest("supports",w||_);var T=C.testStyles=l;Modernizr.addTest("touchevents",function(){var n;if("ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch)n=!0;else{var r=["@media (",E.join("touch-enabled),("),"heartz",")","{#modernizr{top:9px;position:absolute}}"].join("");T(r,function(e){n=9===e.offsetTop})}return n});var z="Moz O ms Webkit",N=C._config.usePrefixes?z.split(" "):[];C._cssomPrefixes=N;var j=C._config.usePrefixes?z.toLowerCase().split(" "):[];C._domPrefixes=j;var k={elem:s("modernizr")};Modernizr._q.push(function(){delete k.elem});var P={style:k.elem.style};Modernizr._q.unshift(function(){delete P.style}),C.testAllProps=v,C.testAllProps=g,Modernizr.addTest("flexbox",g("flexBasis","1px",!0)),Modernizr.addTest("flexboxlegacy",g("boxDirection","reverse",!0)),Modernizr.addTest("csstransforms",function(){return-1===navigator.userAgent.indexOf("Android 2.")&&g("transform","scale(1)",!0)}),Modernizr.addTest("csstransforms3d",function(){var e=!!g("perspective","1px",!0),t=Modernizr._config.usePrefixes;if(e&&(!t||"webkitPerspective"in b.style)){var n,r="#modernizr{width:0;height:0}";Modernizr.supports?n="@supports (perspective: 1px)":(n="@media (transform-3d)",t&&(n+=",(-webkit-transform-3d)")),n+="{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}",T(r+n,function(t){e=7===t.offsetWidth&&18===t.offsetHeight})}return e}),o(),i(y),delete C.addTest,delete C.addAsyncTest;for(var F=0;F=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this); "undefined"!=typeof jQuery&&(jQuery.noConflict(),function(t){"use strict";t(function(){var o={init:function(){this.output_custom_css(),this.carousel(),this.setup_parallax(),this.setup_ytp()},output_custom_css:function(){var o=lsow_settings.custom_css;void 0!==o&&""!=o&&(o='",t("head").append(o))},isMobile:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?!0:!1},vendor_prefix:function(){function t(){var o=window.getComputedStyle(document.documentElement,"");return t=(Array.prototype.slice.call(o).join("").match(/-(moz|webkit|ms)-/)||""===o.OLink&&["","o"])[1]}var t;return t(),t},carousel:function(){if(void 0!==t().slick){var o=t(".lsow-carousel, .lsow-posts-carousel, .lsow-gallery-carousel");o.each(function(){var o=t(this),e=o.data("arrows")?!0:!1,a=o.data("dots")?!0:!1,i=o.data("autoplay")?!0:!1,s=o.data("autoplay_speed")||3e3,n=o.data("animation_speed")||300,l=(o.data("fade")?!0:!1,o.data("pause_on_hover")?!0:!1),r=o.data("display_columns")||4,u=o.data("scroll_columns")||4,d=(o.data("gutter")||10,o.data("tablet_width")||800),c=o.data("tablet_display_columns")||2,p=o.data("tablet_scroll_columns")||2,m=o.data("mobile_width")||480,w=o.data("mobile_display_columns")||1,_=o.data("mobile_scroll_columns")||1;o.slick({arrows:e,dots:a,infinite:!0,autoplay:i,autoplaySpeed:s,speed:n,fade:!1,pauseOnHover:l,slidesToShow:r,slidesToScroll:u,responsive:[{breakpoint:d,settings:{slidesToShow:c,slidesToScroll:p}},{breakpoint:m,settings:{slidesToShow:w,slidesToScroll:_}}]})})}},setup_parallax:function(){function e(){if(o.isMobile()===!1){var e=t(window).height();t(".lsow-section-bg-parallax").each(function(){var a=t(this),i=a.outerHeight(!0),s=a[0].getBoundingClientRect();if(s.bottom>=0&&s.top<=e){var n=e+i,l=e-s.top,r=50,u=r*Math.abs(l/n);u=-u.toFixed(2),a.find(".lsow-parallax-bg").css("-"+o.vendor_prefix()+"-transform","translate3d(0px, "+u+"%, 0px)")}})}}var a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(t){window.setTimeout(t,1e3/600)};this.isMobile()===!1&&(a(e),t(window).on("scroll",function(){a(e)}))},setup_ytp:function(){this.isMobile()||void 0===t().mb_YTPlayer||t(".lsow-section-bg-youtube").mb_YTPlayer({startAt:0,showYTLogo:!1,showControls:!1,autoPlay:!0,mute:!0,containment:"self"})}};o.init()})}(jQuery)); !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(t){function e(t){return t.replace(/(:|\.|\/)/g,"\\$1")}var o="1.6.0",i={},l={exclude:[],excludeWithin:[],offset:0,direction:"top",delegateSelector:null,scrollElement:null,scrollTarget:null,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficient:2,preventDefault:!0},s=function(e){var o=[],i=!1,l=e.dir&&"left"===e.dir?"scrollLeft":"scrollTop";return this.each(function(){var e=t(this);return this!==document&&this!==window?!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(e[l]()>0?o.push(this):(e[l](1),i=e[l]()>0,i&&o.push(this),e[l](0))):(o.push(document.scrollingElement),!1):void 0}),o.length||this.each(function(){"BODY"===this.nodeName&&(o=[this])}),"first"===e.el&&o.length>1&&(o=[o[0]]),o};t.fn.extend({scrollable:function(t){var e=s.call(this,{dir:t});return this.pushStack(e)},firstScrollable:function(t){var e=s.call(this,{el:"first",dir:t});return this.pushStack(e)},smoothScroll:function(o,i){if(o=o||{},"options"===o)return i?this.each(function(){var e=t(this),o=t.extend(e.data("ssOpts")||{},i);t(this).data("ssOpts",o)}):this.first().data("ssOpts");var l=t.extend({},t.fn.smoothScroll.defaults,o),s=function(o){var i=this,s=t(this),n=t.extend({},l,s.data("ssOpts")||{}),c=l.exclude,a=n.excludeWithin,r=0,h=0,u=!0,d={},p=t.smoothScroll.filterPath(location.pathname),f=t.smoothScroll.filterPath(i.pathname),m=location.hostname===i.hostname||!i.hostname,g=n.scrollTarget||f===p,v=e(i.hash);if(n.scrollTarget||m&&g&&v){for(;u&&r1&&"[object Object]"!==String(e)){if(o=jQuery.extend({},o),(null===e||void 0===e)&&(o.expires=-1),"number"==typeof o.expires){var i=o.expires,l=o.expires=new Date;l.setDate(l.getDate()+i)}return e=String(e),document.cookie=[encodeURIComponent(t),"=",o.raw?e:encodeURIComponent(e),o.expires?"; expires="+o.expires.toUTCString():"",o.path?"; path="+o.path:"",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("")}o=e||{};var s,n=o.raw?function(t){return t}:decodeURIComponent;return(s=new RegExp("(?:^|;)"+encodeURIComponent(t)+"=([^;]*)").exec(document.cookie))?n(s[1]):null},jQuery(document).ready(function(t){if("undefined"!=typeof tocplus){if(t.fn.shrinkTOCWidth=function(){t(this).css({width:"auto",display:"table"}),/MSIE 7\./.test(navigator.userAgent)&&t(this).css("width","")},1==tocplus.smooth_scroll){var e=hostname=pathname=qs=hash=null;t("body a").click(function(){if(hostname=t(this).prop("hostname"),pathname=t(this).prop("pathname"),qs=t(this).prop("search"),hash=t(this).prop("hash"),pathname.length>0&&"/"!=pathname.charAt(0)&&(pathname="/"+pathname),window.location.hostname==hostname&&window.location.pathname==pathname&&window.location.search==qs&&""!==hash){var o=hash.replace(/([ !"$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g,"\\$1");t(o).length>0?e=hash:(anchor=hash,anchor=anchor.replace("#",""),e='a[name="'+anchor+'"]',0==t(e).length&&(e="")),offset="undefined"!=typeof tocplus.smooth_scroll_offset?-1*tocplus.smooth_scroll_offset:t("#wpadminbar").length>0&&t("#wpadminbar").is(":visible")?-30:0,e&&t.smoothScroll({scrollTarget:e,offset:offset})}})}if("undefined"!=typeof tocplus.visibility_show){var o="undefined"!=typeof tocplus.visibility_hide_by_default?!0:!1;if(t.cookie)var i=t.cookie("tocplus_hidetoc")?tocplus.visibility_show:tocplus.visibility_hide;else var i=tocplus.visibility_hide;o&&(i=i==tocplus.visibility_hide?tocplus.visibility_show:tocplus.visibility_hide),t("#toc_container p.toc_title").append(' ['+i+"]"),i==tocplus.visibility_show&&(t("ul.toc_list").hide(),t("#toc_container").addClass("contracted").shrinkTOCWidth()),t("span.toc_toggle a").click(function(e){switch(e.preventDefault(),t(this).html()){case t("
    ").html(tocplus.visibility_hide).text():t(this).html(tocplus.visibility_show),t.cookie&&(o?t.cookie("tocplus_hidetoc",null,{path:"/"}):t.cookie("tocplus_hidetoc","1",{expires:30,path:"/"})),t("ul.toc_list").hide("fast"),t("#toc_container").addClass("contracted").shrinkTOCWidth();break;case t("
    ").html(tocplus.visibility_show).text():default:t(this).html(tocplus.visibility_hide),t.cookie&&(o?t.cookie("tocplus_hidetoc","1",{expires:30,path:"/"}):t.cookie("tocplus_hidetoc",null,{path:"/"})),t("#toc_container").css("width",tocplus.width).removeClass("contracted"),t("ul.toc_list").show("fast")}})}}}); var ytp=ytp||{}; function onYouTubeIframeAPIReady(){ if(ytp.YTAPIReady) return; ytp.YTAPIReady=true; jQuery(document).trigger("YTAPIReady"); } var getYTPVideoID=function(url){ var videoID, playlistID; if(url.indexOf("youtu.be") > 0){ videoID=url.substr(url.lastIndexOf("/") + 1, url.length); playlistID=videoID.indexOf("?list=") > 0 ? videoID.substr(videoID.lastIndexOf("="), videoID.length):null; videoID=playlistID ? videoID.substr(0, videoID.lastIndexOf("?")):videoID; }else if(url.indexOf("http") > -1){ videoID=url.match(/[\\?&]v=([^&#]*)/)[ 1 ]; playlistID=url.indexOf("list=") > 0 ? url.match(/[\\?&]list=([^&#]*)/)[ 1 ]:null; }else{ videoID=url.length > 15 ? null:url; playlistID=videoID ? null:url; } return { videoID: videoID, playlistID: playlistID };}; (function(jQuery, ytp){ jQuery.mbYTPlayer={ name: "jquery.mb.YTPlayer", version: "3.0.20", build: "6273", author: "Matteo Bicocchi (pupunzi)", apiKey: "", defaults: { containment: "body", ratio: "auto", // "auto", "16/9", "4/3" or number: 4/3, 16/9 videoURL: null, playlistURL: null, startAt: 0, stopAt: 0, autoPlay: true, vol: 50, addRaster: false, mask: false, opacity: 1, quality: "default", mute: false, loop: true, fadeOnStartTime: 500, showControls: true, showAnnotations: false, showYTLogo: true, stopMovieOnBlur: true, realfullscreen: true, mobileFallbackImage: null, gaTrack: true, optimizeDisplay: true, remember_last_time: false, playOnlyIfVisible: false, anchor: "center,center", onReady: function(player){}, onError: function(player, err){}}, controls: { play: "P", pause: "p", mute: "M", unmute: "A", onlyYT: "O", showSite: "R", ytLogo: "Y" }, controlBar: null, loading: null, locationProtocol: "https:", filters: { grayscale: { value: 0, unit: "%" }, hue_rotate: { value: 0, unit: "deg" }, invert: { value: 0, unit: "%" }, opacity: { value: 0, unit: "%" }, saturate: { value: 0, unit: "%" }, sepia: { value: 0, unit: "%" }, brightness: { value: 0, unit: "%" }, contrast: { value: 0, unit: "%" }, blur: { value: 0, unit: "px" }}, buildPlayer: function(options){ return this.each(function(){ var YTPlayer=this; var $YTPlayer=jQuery(YTPlayer); YTPlayer.loop=0; YTPlayer.opt={}; YTPlayer.state=0; YTPlayer.filters=jQuery.mbYTPlayer.filters; YTPlayer.filtersEnabled=true; YTPlayer.id=YTPlayer.id||"YTP_" + new Date().getTime(); $YTPlayer.addClass("mb_YTPlayer"); var property=$YTPlayer.data("property")&&typeof $YTPlayer.data("property")=="string" ? eval('(' + $YTPlayer.data("property") + ')'):$YTPlayer.data("property"); if(typeof property!="undefined"&&typeof property.vol!="undefined") property.vol=property.vol===0 ? property.vol=1:property.vol; jQuery.extend(YTPlayer.opt, jQuery.mbYTPlayer.defaults, options, property); if(!YTPlayer.hasChanged){ YTPlayer.defaultOpt={}; jQuery.extend(YTPlayer.defaultOpt, jQuery.mbYTPlayer.defaults, options); } if(YTPlayer.opt.loop=="true") YTPlayer.opt.loop=9999; YTPlayer.isRetina=(window.retina||window.devicePixelRatio > 1); var isIframe=function(){ var isIfr=false; try { if(self.location.href!=top.location.href) isIfr=true; } catch(e){ isIfr=true; } return isIfr; }; YTPlayer.canGoFullScreen = !(jQuery.mbBrowser.msie||jQuery.mbBrowser.opera||isIframe()); if(!YTPlayer.canGoFullScreen) YTPlayer.opt.realfullscreen=false; if(!$YTPlayer.attr("id")) $YTPlayer.attr("id", "ytp_" + new Date().getTime()); var playerID="iframe_" + YTPlayer.id; YTPlayer.isAlone=false; YTPlayer.hasFocus=true; YTPlayer.videoID=this.opt.videoURL ? getYTPVideoID(this.opt.videoURL).videoID:$YTPlayer.attr("href") ? getYTPVideoID($YTPlayer.attr("href")).videoID:false; YTPlayer.playlistID=this.opt.videoURL ? getYTPVideoID(this.opt.videoURL).playlistID:$YTPlayer.attr("href") ? getYTPVideoID($YTPlayer.attr("href")).playlistID:false; YTPlayer.opt.showAnnotations=YTPlayer.opt.showAnnotations ? '1':'3'; var start_from_last=0; if(jQuery.mbCookie.get("YTPlayer_start_from" + YTPlayer.videoID)) start_from_last=parseFloat(jQuery.mbCookie.get("YTPlayer_start_from" + YTPlayer.videoID)); if(YTPlayer.opt.remember_last_time&&start_from_last){ YTPlayer.start_from_last=start_from_last; jQuery.mbCookie.remove("YTPlayer_start_from" + YTPlayer.videoID); } var playerVars={ 'modestbranding': 1, 'autoplay': 0, 'controls': 0, 'showinfo': 0, 'rel': 0, 'enablejsapi': 1, 'version': 3, 'playerapiid': playerID, 'origin': '*', 'allowfullscreen': true, 'wmode': 'transparent', 'iv_load_policy': YTPlayer.opt.showAnnotations }; if(document.createElement('video').canPlayType) jQuery.extend(playerVars, { 'html5': 1 }); if(jQuery.mbBrowser.msie&&jQuery.mbBrowser.version < 9) this.opt.opacity=1; YTPlayer.isSelf=YTPlayer.opt.containment=="self"; YTPlayer.defaultOpt.containment=YTPlayer.opt.containment=YTPlayer.opt.containment=="self" ? jQuery(this):jQuery(YTPlayer.opt.containment); YTPlayer.isBackground=YTPlayer.opt.containment.is("body"); if(YTPlayer.isBackground&&ytp.backgroundIsInited) return; var isPlayer=YTPlayer.opt.containment.is(jQuery(this)); YTPlayer.canPlayOnMobile=isPlayer&&jQuery(this).children().length===0; YTPlayer.isPlayer=false; if(!isPlayer){ $YTPlayer.hide(); }else{ YTPlayer.isPlayer=true; } var overlay=jQuery("
    ").css({ position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }).addClass("YTPOverlay"); if(YTPlayer.isPlayer){ overlay.on("click", function(){ $YTPlayer.YTPTogglePlay(); }) } var wrapper=jQuery("
    ").addClass("mbYTP_wrapper").attr("id", "wrapper_" + YTPlayer.id); wrapper.css({ position: "absolute", zIndex: 0, minWidth: "100%", minHeight: "100%", left: 0, top: 0, overflow: "hidden", opacity: 0 }); var playerBox=jQuery("
    ").attr("id", playerID).addClass("playerBox"); playerBox.css({ position: "absolute", zIndex: 0, width: "100%", height: "100%", top: 0, left: 0, overflow: "hidden" }); wrapper.append(playerBox); YTPlayer.opt.containment.children().not("script, style").each(function(){ if(jQuery(this).css("position")=="static") jQuery(this).css("position", "relative"); }); if(YTPlayer.isBackground){ jQuery("body").css({ boxSizing: "border-box" }); wrapper.css({ position: "fixed", top: 0, left: 0, zIndex: 0 }); $YTPlayer.hide(); }else if(YTPlayer.opt.containment.css("position")=="static") YTPlayer.opt.containment.css({ position: "relative" }); YTPlayer.opt.containment.prepend(wrapper); YTPlayer.wrapper=wrapper; playerBox.css({ opacity: 1 }); if(!jQuery.mbBrowser.mobile){ playerBox.after(overlay); YTPlayer.overlay=overlay; } if(!YTPlayer.isBackground){ overlay.on("mouseenter", function(){ if(YTPlayer.controlBar&&YTPlayer.controlBar.length) YTPlayer.controlBar.addClass("visible"); }).on("mouseleave", function(){ if(YTPlayer.controlBar&&YTPlayer.controlBar.length) YTPlayer.controlBar.removeClass("visible"); }); } if(!ytp.YTAPIReady){ jQuery("#YTAPI").remove(); var tag=jQuery("").attr({ "src": jQuery.mbYTPlayer.locationProtocol + "//www.youtube.com/iframe_api?v=" + jQuery.mbYTPlayer.version, "id": "YTAPI" }); jQuery("head").prepend(tag); }else{ setTimeout(function(){ jQuery(document).trigger("YTAPIReady"); }, 100) } if(jQuery.mbBrowser.mobile&&!YTPlayer.canPlayOnMobile){ if(YTPlayer.opt.mobileFallbackImage){ wrapper.css({ backgroundImage: "url(" + YTPlayer.opt.mobileFallbackImage + ")", backgroundPosition: "center center", backgroundSize: "cover", backgroundRepeat: "no-repeat", opacity: 1 }) }; if(!YTPlayer.isPlayer) $YTPlayer.remove(); jQuery(document).trigger("YTPUnavailable"); return; } jQuery(document).on("YTAPIReady", function(){ if(( YTPlayer.isBackground&&ytp.backgroundIsInited)||YTPlayer.isInit) return; if(YTPlayer.isBackground){ ytp.backgroundIsInited=true; } YTPlayer.opt.autoPlay=typeof YTPlayer.opt.autoPlay=="undefined" ?(YTPlayer.isBackground ? true:false):YTPlayer.opt.autoPlay; YTPlayer.opt.vol=YTPlayer.opt.vol ? YTPlayer.opt.vol:100; jQuery.mbYTPlayer.getDataFromAPI(YTPlayer); jQuery(YTPlayer).on("YTPChanged", function(){ if(YTPlayer.isInit) return; YTPlayer.isInit=true; if(jQuery.mbBrowser.mobile&&YTPlayer.canPlayOnMobile){ if(YTPlayer.opt.containment.outerWidth() > jQuery(window).width()){ YTPlayer.opt.containment.css({ maxWidth: "100%" }); var h=YTPlayer.opt.containment.outerWidth() * .563; YTPlayer.opt.containment.css({ maxHeight: h }); } new YT.Player(playerID, { videoId: YTPlayer.videoID.toString(), width: '100%', height: h, playerVars: playerVars, events: { 'onReady': function(event){ YTPlayer.player=event.target; playerBox.css({ opacity: 1 }); YTPlayer.wrapper.css({ opacity: 1 }); }} }); return; } new YT.Player(playerID, { videoId: YTPlayer.videoID.toString(), playerVars: playerVars, events: { 'onReady': function(event){ YTPlayer.player=event.target; if(YTPlayer.isReady) return; YTPlayer.isReady=YTPlayer.isPlayer&&!YTPlayer.opt.autoPlay ? false:true; YTPlayer.playerEl=YTPlayer.player.getIframe(); jQuery(YTPlayer.playerEl).unselectable(); $YTPlayer.optimizeDisplay(); jQuery(window).off("resize.YTP_" + YTPlayer.id).on("resize.YTP_" + YTPlayer.id, function(){ $YTPlayer.optimizeDisplay(); }); if(YTPlayer.opt.remember_last_time){ jQuery(window).on("unload.YTP_" + YTPlayer.id, function(){ var current_time=YTPlayer.player.getCurrentTime(); jQuery.mbCookie.set("YTPlayer_start_from" + YTPlayer.videoID, current_time, 0); }); } jQuery.mbYTPlayer.checkForState(YTPlayer); }, 'onStateChange': function(event){ if(typeof event.target.getPlayerState!="function") return; var state=event.target.getPlayerState(); if(YTPlayer.preventTrigger){ YTPlayer.preventTrigger=false; return } YTPlayer.state=state; var eventType; switch(state){ case -1: eventType="YTPUnstarted"; break; case 0: eventType="YTPRealEnd"; break; case 1: eventType="YTPPlay"; if(YTPlayer.controlBar.length) YTPlayer.controlBar.find(".mb_YTPPlaypause").html(jQuery.mbYTPlayer.controls.pause); if(typeof _gaq!="undefined"&&eval(YTPlayer.opt.gaTrack)) _gaq.push([ '_trackEvent', 'YTPlayer', 'Play',(YTPlayer.hasData ? YTPlayer.videoData.title:YTPlayer.videoID.toString()) ]); if(typeof ga!="undefined"&&eval(YTPlayer.opt.gaTrack)) ga('send', 'event', 'YTPlayer', 'play',(YTPlayer.hasData ? YTPlayer.videoData.title:YTPlayer.videoID.toString())); break; case 2: eventType="YTPPause"; if(YTPlayer.controlBar.length) YTPlayer.controlBar.find(".mb_YTPPlaypause").html(jQuery.mbYTPlayer.controls.play); break; case 3: YTPlayer.player.setPlaybackQuality(YTPlayer.opt.quality); eventType="YTPBuffering"; if(YTPlayer.controlBar.length) YTPlayer.controlBar.find(".mb_YTPPlaypause").html(jQuery.mbYTPlayer.controls.play); break; case 5: eventType="YTPCued"; break; default: break; } var YTPEvent=jQuery.Event(eventType); YTPEvent.time=YTPlayer.currentTime; if(YTPlayer.canTrigger) jQuery(YTPlayer).trigger(YTPEvent); }, 'onPlaybackQualityChange': function(e){ var quality=e.target.getPlaybackQuality(); var YTPQualityChange=jQuery.Event("YTPQualityChange"); YTPQualityChange.quality=quality; jQuery(YTPlayer).trigger(YTPQualityChange); }, 'onError': function(err){ if(err.data==150){ console.log("Embedding this video is restricted by Youtube."); if(YTPlayer.isPlayList) jQuery(YTPlayer).playNext(); } if(err.data==2&&YTPlayer.isPlayList){ jQuery(YTPlayer).playNext(); } if(typeof YTPlayer.opt.onError=="function") YTPlayer.opt.onError($YTPlayer, err); }} }); }); }); $YTPlayer.off("YTPTime.mask"); jQuery.mbYTPlayer.applyMask(YTPlayer); }); }, isOnScreen: function(YTPlayer){ var playerBox=YTPlayer.wrapper; var winTop=$(window).scrollTop(); var winBottom=winTop + $(window).height(); var elTop=playerBox.offset().top; var elBottom=elTop + playerBox.height(); return(( elBottom <=winBottom)&&(elTop >=winTop)); }, getDataFromAPI: function(YTPlayer){ YTPlayer.videoData=jQuery.mbStorage.get("YTPlayer_data_" + YTPlayer.videoID); jQuery(YTPlayer).off("YTPData.YTPlayer").on("YTPData.YTPlayer", function(){ if(YTPlayer.hasData){ if(YTPlayer.isPlayer&&!YTPlayer.opt.autoPlay){ var bgndURL=YTPlayer.videoData.thumb_max||YTPlayer.videoData.thumb_high||YTPlayer.videoData.thumb_medium; YTPlayer.opt.containment.css({ background: "rgba(0,0,0,0.5) url(" + bgndURL + ") center center", backgroundSize: "cover" }); YTPlayer.opt.backgroundUrl=bgndURL; }} }); if(YTPlayer.videoData){ setTimeout(function(){ YTPlayer.opt.ratio=YTPlayer.opt.ratio=="auto" ? "16/9":YTPlayer.opt.ratio; YTPlayer.dataReceived=true; jQuery(YTPlayer).trigger("YTPChanged"); var YTPData=jQuery.Event("YTPData"); YTPData.prop={}; for(var x in YTPlayer.videoData) YTPData.prop[ x ]=YTPlayer.videoData[ x ]; jQuery(YTPlayer).trigger(YTPData); }, YTPlayer.opt.fadeOnStartTime); YTPlayer.hasData=true; }else if(jQuery.mbYTPlayer.apiKey){ jQuery.getJSON(jQuery.mbYTPlayer.locationProtocol + "//www.googleapis.com/youtube/v3/videos?id=" + YTPlayer.videoID + "&key=" + jQuery.mbYTPlayer.apiKey + "&part=snippet", function(data){ YTPlayer.dataReceived=true; jQuery(YTPlayer).trigger("YTPChanged"); function parseYTPlayer_data(data){ YTPlayer.videoData={}; YTPlayer.videoData.id=YTPlayer.videoID; YTPlayer.videoData.channelTitle=data.channelTitle; YTPlayer.videoData.title=data.title; YTPlayer.videoData.description=data.description.length < 400 ? data.description:data.description.substring(0, 400) + " ..."; YTPlayer.videoData.aspectratio=YTPlayer.opt.ratio=="auto" ? "16/9":YTPlayer.opt.ratio; YTPlayer.opt.ratio=YTPlayer.videoData.aspectratio; YTPlayer.videoData.thumb_max=data.thumbnails.maxres ? data.thumbnails.maxres.url:null; YTPlayer.videoData.thumb_high=data.thumbnails.high ? data.thumbnails.high.url:null; YTPlayer.videoData.thumb_medium=data.thumbnails.medium ? data.thumbnails.medium.url:null; jQuery.mbStorage.set("YTPlayer_data_" + YTPlayer.videoID, YTPlayer.videoData); } parseYTPlayer_data(data.items[ 0 ].snippet); YTPlayer.hasData=true; var YTPData=jQuery.Event("YTPData"); YTPData.prop={}; for(var x in YTPlayer.videoData) YTPData.prop[ x ]=YTPlayer.videoData[ x ]; jQuery(YTPlayer).trigger(YTPData); }); }else{ setTimeout(function(){ jQuery(YTPlayer).trigger("YTPChanged"); }, 50); if(YTPlayer.isPlayer&&!YTPlayer.opt.autoPlay){ var bgndURL=jQuery.mbYTPlayer.locationProtocol + "//i.ytimg.com/vi/" + YTPlayer.videoID + "/hqdefault.jpg"; if(bgndURL) YTPlayer.opt.containment.css({ background: "rgba(0,0,0,0.5) url(" + bgndURL + ") center center", backgroundSize: "cover" }); YTPlayer.opt.backgroundUrl=bgndURL; } YTPlayer.videoData=null; YTPlayer.opt.ratio=YTPlayer.opt.ratio=="auto" ? "16/9":YTPlayer.opt.ratio; } if(YTPlayer.isPlayer&&!YTPlayer.opt.autoPlay&&!jQuery.mbBrowser.mobile){ YTPlayer.loading=jQuery("
    ").addClass("loading").html("Loading").hide(); jQuery(YTPlayer).append(YTPlayer.loading); YTPlayer.loading.fadeIn(); }}, removeStoredData: function(){ jQuery.mbStorage.remove(); }, getVideoData: function(){ var YTPlayer=this.get(0); return YTPlayer.videoData; }, getVideoID: function(){ var YTPlayer=this.get(0); return YTPlayer.videoID||false; }, setVideoQuality: function(quality){ var YTPlayer=this.get(0); YTPlayer.player.setPlaybackQuality(quality); }, playlist: function(videos, shuffle, callback){ var $YTPlayer=this; var YTPlayer=$YTPlayer.get(0); YTPlayer.isPlayList=true; if(shuffle) videos=jQuery.shuffle(videos); if(!YTPlayer.videoID){ YTPlayer.videos=videos; YTPlayer.videoCounter=0; YTPlayer.videoLength=videos.length; jQuery(YTPlayer).data("property", videos[ 0 ]); jQuery(YTPlayer).mb_YTPlayer(); } if(typeof callback=="function") jQuery(YTPlayer).one("YTPChanged", function(){ callback(YTPlayer); }); jQuery(YTPlayer).on("YTPEnd", function(){ jQuery(YTPlayer).playNext(); }); return this; }, playNext: function(){ var YTPlayer=this.get(0); if(YTPlayer.checkForStartAt){ clearInterval(YTPlayer.checkForStartAt); clearInterval(YTPlayer.getState); } YTPlayer.videoCounter++; if(YTPlayer.videoCounter >=YTPlayer.videoLength) YTPlayer.videoCounter=0; jQuery(YTPlayer).YTPChangeMovie(YTPlayer.videos[ YTPlayer.videoCounter ]); return this; }, playPrev: function(){ var YTPlayer=this.get(0); if(YTPlayer.checkForStartAt){ clearInterval(YTPlayer.checkForStartAt); clearInterval(YTPlayer.getState); } YTPlayer.videoCounter--; if(YTPlayer.videoCounter < 0) YTPlayer.videoCounter=YTPlayer.videoLength - 1; jQuery(YTPlayer).YTPChangeMovie(YTPlayer.videos[ YTPlayer.videoCounter ]); return this; }, playIndex: function(idx){ var YTPlayer=this.get(0); idx=idx - 1; if(YTPlayer.checkForStartAt){ clearInterval(YTPlayer.checkForStartAt); clearInterval(YTPlayer.getState); } YTPlayer.videoCounter=idx; if(YTPlayer.videoCounter >=YTPlayer.videoLength - 1) YTPlayer.videoCounter=YTPlayer.videoLength - 1; jQuery(YTPlayer).YTPChangeMovie(YTPlayer.videos[ YTPlayer.videoCounter ]); return this; }, changeMovie: function(opt){ var $YTPlayer=this; var YTPlayer=$YTPlayer.get(0); YTPlayer.opt.startAt=0; YTPlayer.opt.stopAt=0; YTPlayer.opt.mask=false; YTPlayer.opt.mute=true; YTPlayer.hasData=false; YTPlayer.hasChanged=true; YTPlayer.player.loopTime=undefined; if(opt) jQuery.extend(YTPlayer.opt, opt); //YTPlayer.defaultOpt, YTPlayer.videoID=getYTPVideoID(YTPlayer.opt.videoURL).videoID; if(YTPlayer.opt.loop=="true") YTPlayer.opt.loop=9999; jQuery(YTPlayer.playerEl).CSSAnimate({ opacity: 0 }, YTPlayer.opt.fadeOnStartTime, function(){ var YTPChangeMovie=jQuery.Event("YTPChangeMovie"); YTPChangeMovie.time=YTPlayer.currentTime; YTPChangeMovie.videoId=YTPlayer.videoID; jQuery(YTPlayer).trigger(YTPChangeMovie); jQuery(YTPlayer).YTPGetPlayer().cueVideoByUrl(encodeURI(jQuery.mbYTPlayer.locationProtocol + "//www.youtube.com/v/" + YTPlayer.videoID), 1, YTPlayer.opt.quality); jQuery(YTPlayer).optimizeDisplay(); jQuery.mbYTPlayer.checkForState(YTPlayer); jQuery.mbYTPlayer.getDataFromAPI(YTPlayer); }); jQuery.mbYTPlayer.applyMask(YTPlayer); }, getPlayer: function(){ return jQuery(this).get(0).player; }, playerDestroy: function(){ var YTPlayer=this.get(0); ytp.YTAPIReady=true; ytp.backgroundIsInited=false; YTPlayer.isInit=false; YTPlayer.videoID=null; YTPlayer.isReady=false; var playerBox=YTPlayer.wrapper; playerBox.remove(); jQuery("#controlBar_" + YTPlayer.id).remove(); clearInterval(YTPlayer.checkForStartAt); clearInterval(YTPlayer.getState); return this; }, fullscreen: function(real){ var YTPlayer=this.get(0); if(typeof real=="undefined") real=YTPlayer.opt.realfullscreen; real=eval(real); var controls=jQuery("#controlBar_" + YTPlayer.id); var fullScreenBtn=controls.find(".mb_OnlyYT"); var videoWrapper=YTPlayer.isSelf ? YTPlayer.opt.containment:YTPlayer.wrapper; if(real){ var fullscreenchange=jQuery.mbBrowser.mozilla ? "mozfullscreenchange":jQuery.mbBrowser.webkit ? "webkitfullscreenchange":"fullscreenchange"; jQuery(document).off(fullscreenchange).on(fullscreenchange, function(){ var isFullScreen=RunPrefixMethod(document, "IsFullScreen")||RunPrefixMethod(document, "FullScreen"); if(!isFullScreen){ YTPlayer.isAlone=false; fullScreenBtn.html(jQuery.mbYTPlayer.controls.onlyYT); jQuery(YTPlayer).YTPSetVideoQuality(YTPlayer.opt.quality); videoWrapper.removeClass("YTPFullscreen"); videoWrapper.css({ opacity: YTPlayer.opt.opacity }); videoWrapper.css({ zIndex: 0 }); if(YTPlayer.isBackground){ jQuery("body").after(controls); }else{ YTPlayer.wrapper.before(controls); } jQuery(window).resize(); jQuery(YTPlayer).trigger("YTPFullScreenEnd"); }else{ jQuery(YTPlayer).YTPSetVideoQuality("default"); jQuery(YTPlayer).trigger("YTPFullScreenStart"); }}); } if(!YTPlayer.isAlone){ function hideMouse(){ YTPlayer.overlay.css({ cursor: "none" }); } jQuery(document).on("mousemove.YTPlayer", function(e){ YTPlayer.overlay.css({ cursor: "auto" }); clearTimeout(YTPlayer.hideCursor); if(!jQuery(e.target).parents().is(".mb_YTPBar")) YTPlayer.hideCursor=setTimeout(hideMouse, 3000); }); hideMouse(); if(real){ videoWrapper.css({ opacity: 0 }); videoWrapper.addClass("YTPFullscreen"); launchFullscreen(videoWrapper.get(0)); setTimeout(function(){ videoWrapper.css({ opacity: 1 }); YTPlayer.wrapper.append(controls); jQuery(YTPlayer).optimizeDisplay(); YTPlayer.player.seekTo(YTPlayer.player.getCurrentTime() + .1, true); }, YTPlayer.opt.fadeOnStartTime) } else videoWrapper.css({ zIndex: 10000 }).css({ opacity: 1 }); fullScreenBtn.html(jQuery.mbYTPlayer.controls.showSite); YTPlayer.isAlone=true; }else{ jQuery(document).off("mousemove.YTPlayer"); clearTimeout(YTPlayer.hideCursor); YTPlayer.overlay.css({ cursor: "auto" }); if(real){ cancelFullscreen(); }else{ videoWrapper.CSSAnimate({ opacity: YTPlayer.opt.opacity }, YTPlayer.opt.fadeOnStartTime); videoWrapper.css({ zIndex: 0 }); } fullScreenBtn.html(jQuery.mbYTPlayer.controls.onlyYT); YTPlayer.isAlone=false; } function RunPrefixMethod(obj, method){ var pfx=[ "webkit", "moz", "ms", "o", "" ]; var p=0, m, t; while(p < pfx.length&&!obj[ m ]){ m=method; if(pfx[ p ]==""){ m=m.substr(0, 1).toLowerCase() + m.substr(1); } m=pfx[ p ] + m; t=typeof obj[ m ]; if(t!="undefined"){ pfx=[ pfx[ p ] ]; return(t=="function" ? obj[ m ]():obj[ m ]); } p++; }} function launchFullscreen(element){ RunPrefixMethod(element, "RequestFullScreen"); } function cancelFullscreen(){ if(RunPrefixMethod(document, "FullScreen")||RunPrefixMethod(document, "IsFullScreen")){ RunPrefixMethod(document, "CancelFullScreen"); }} return this; }, toggleLoops: function(){ var YTPlayer=this.get(0); var data=YTPlayer.opt; if(data.loop==1){ data.loop=0; }else{ if(data.startAt){ YTPlayer.player.seekTo(data.startAt); }else{ YTPlayer.player.playVideo(); } data.loop=1; } return this; }, play: function(){ var YTPlayer=this.get(0); if(!YTPlayer.isReady) return this; YTPlayer.player.playVideo(); YTPlayer.wrapper.css({ opacity: YTPlayer.isAlone ? 1:YTPlayer.opt.opacity }); jQuery(YTPlayer.playerEl).css({ opacity: 1 }); var controls=jQuery("#controlBar_" + YTPlayer.id); var playBtn=controls.find(".mb_YTPPlaypause"); playBtn.html(jQuery.mbYTPlayer.controls.pause); YTPlayer.state=1; YTPlayer.orig_background=jQuery(YTPlayer).css("background-image"); return this; }, togglePlay: function(callback){ var YTPlayer=this.get(0); if(YTPlayer.state==1) this.YTPPause(); else this.YTPPlay(); if(typeof callback=="function") callback(YTPlayer.state); return this; }, stop: function(){ var YTPlayer=this.get(0); var controls=jQuery("#controlBar_" + YTPlayer.id); var playBtn=controls.find(".mb_YTPPlaypause"); playBtn.html(jQuery.mbYTPlayer.controls.play); YTPlayer.player.stopVideo(); return this; }, pause: function(){ var YTPlayer=this.get(0); YTPlayer.player.pauseVideo(); YTPlayer.state=2; return this; }, seekTo: function(val){ var YTPlayer=this.get(0); YTPlayer.player.seekTo(val, true); return this; }, setVolume: function(val){ var YTPlayer=this.get(0); if(!val&&!YTPlayer.opt.vol&&YTPlayer.player.getVolume()==0) jQuery(YTPlayer).YTPUnmute(); else if(( !val&&YTPlayer.player.getVolume() > 0)||(val&&YTPlayer.opt.vol==val)){ if(!YTPlayer.isMute) jQuery(YTPlayer).YTPMute(); else jQuery(YTPlayer).YTPUnmute(); }else{ YTPlayer.opt.vol=val; YTPlayer.player.setVolume(YTPlayer.opt.vol); if(YTPlayer.volumeBar&&YTPlayer.volumeBar.length) YTPlayer.volumeBar.updateSliderVal(val) } return this; }, toggleVolume: function(){ var YTPlayer=this.get(0); if(!YTPlayer) return; if(YTPlayer.player.isMuted()){ jQuery(YTPlayer).YTPUnmute(); return true; }else{ jQuery(YTPlayer).YTPMute(); return false; }}, mute: function(){ var YTPlayer=this.get(0); if(YTPlayer.isMute) return; YTPlayer.player.mute(); YTPlayer.isMute=true; YTPlayer.player.setVolume(0); if(YTPlayer.volumeBar&&YTPlayer.volumeBar.length&&YTPlayer.volumeBar.width() > 10){ YTPlayer.volumeBar.updateSliderVal(0); } var controls=jQuery("#controlBar_" + YTPlayer.id); var muteBtn=controls.find(".mb_YTPMuteUnmute"); muteBtn.html(jQuery.mbYTPlayer.controls.unmute); jQuery(YTPlayer).addClass("isMuted"); if(YTPlayer.volumeBar&&YTPlayer.volumeBar.length) YTPlayer.volumeBar.addClass("muted"); var YTPEvent=jQuery.Event("YTPMuted"); YTPEvent.time=YTPlayer.currentTime; if(YTPlayer.canTrigger) jQuery(YTPlayer).trigger(YTPEvent); return this; }, unmute: function(){ var YTPlayer=this.get(0); if(!YTPlayer.isMute) return; YTPlayer.player.unMute(); YTPlayer.isMute=false; YTPlayer.player.setVolume(YTPlayer.opt.vol); if(YTPlayer.volumeBar&&YTPlayer.volumeBar.length) YTPlayer.volumeBar.updateSliderVal(YTPlayer.opt.vol > 10 ? YTPlayer.opt.vol:10); var controls=jQuery("#controlBar_" + YTPlayer.id); var muteBtn=controls.find(".mb_YTPMuteUnmute"); muteBtn.html(jQuery.mbYTPlayer.controls.mute); jQuery(YTPlayer).removeClass("isMuted"); if(YTPlayer.volumeBar&&YTPlayer.volumeBar.length) YTPlayer.volumeBar.removeClass("muted"); var YTPEvent=jQuery.Event("YTPUnmuted"); YTPEvent.time=YTPlayer.currentTime; if(YTPlayer.canTrigger) jQuery(YTPlayer).trigger(YTPEvent); return this; }, applyFilter: function(filter, value){ return this.each(function(){ var YTPlayer=this; YTPlayer.filters[ filter ].value=value; if(YTPlayer.filtersEnabled) jQuery(YTPlayer).YTPEnableFilters(); }); }, applyFilters: function(filters){ return this.each(function(){ var YTPlayer=this; if(!YTPlayer.isReady){ jQuery(YTPlayer).on("YTPReady", function(){ jQuery(YTPlayer).YTPApplyFilters(filters); }); return; } for(var key in filters) jQuery(YTPlayer).YTPApplyFilter(key, filters[ key ]); jQuery(YTPlayer).trigger("YTPFiltersApplied"); }); }, toggleFilter: function(filter, value){ return this.each(function(){ var YTPlayer=this; if(!YTPlayer.filters[ filter ].value) YTPlayer.filters[ filter ].value=value; else YTPlayer.filters[ filter ].value=0; if(YTPlayer.filtersEnabled) jQuery(this).YTPEnableFilters(); }); }, toggleFilters: function(callback){ return this.each(function(){ var YTPlayer=this; if(YTPlayer.filtersEnabled){ jQuery(YTPlayer).trigger("YTPDisableFilters"); jQuery(YTPlayer).YTPDisableFilters(); }else{ jQuery(YTPlayer).YTPEnableFilters(); jQuery(YTPlayer).trigger("YTPEnableFilters"); } if(typeof callback=="function") callback(YTPlayer.filtersEnabled); }) }, disableFilters: function(){ return this.each(function(){ var YTPlayer=this; var iframe=jQuery(YTPlayer.playerEl); iframe.css("-webkit-filter", ""); iframe.css("filter", ""); YTPlayer.filtersEnabled=false; }) }, enableFilters: function(){ return this.each(function(){ var YTPlayer=this; var iframe=jQuery(YTPlayer.playerEl); var filterStyle=""; for(var key in YTPlayer.filters){ if(YTPlayer.filters[ key ].value) filterStyle +=key.replace("_", "-") + "(" + YTPlayer.filters[ key ].value + YTPlayer.filters[ key ].unit + ") "; } iframe.css("-webkit-filter", filterStyle); iframe.css("filter", filterStyle); YTPlayer.filtersEnabled=true; }); }, removeFilter: function(filter, callback){ return this.each(function(){ var YTPlayer=this; if(typeof filter=="function"){ callback=filter; filter=null; } if(!filter) for(var key in YTPlayer.filters){ jQuery(this).YTPApplyFilter(key, 0); if(typeof callback=="function") callback(key); }else{ jQuery(this).YTPApplyFilter(filter, 0); if(typeof callback=="function") callback(filter); }}); }, getFilters: function(){ var YTPlayer=this.get(0); return YTPlayer.filters; }, addMask: function(mask){ var YTPlayer=this.get(0); var overlay=YTPlayer.overlay; if(!mask){ mask=YTPlayer.actualMask; } var tempImg=jQuery("").attr("src", mask).on("load", function(){ overlay.CSSAnimate({ opacity: 0 }, YTPlayer.opt.fadeOnStartTime, function(){ YTPlayer.hasMask=true; tempImg.remove(); overlay.css({ backgroundImage: "url(" + mask + ")", backgroundRepeat: "no-repeat", backgroundPosition: "center center", backgroundSize: "cover" }); overlay.css({ opacity: 1 }); }); }); return this; }, removeMask: function(){ var YTPlayer=this.get(0); var overlay=YTPlayer.overlay; overlay.CSSAnimate({ opacity: 0 }, YTPlayer.opt.fadeOnStartTime, function(){ YTPlayer.hasMask=false; overlay.css({ backgroundImage: "", backgroundRepeat: "", backgroundPosition: "", backgroundSize: "" }); overlay.css({ opacity: 1 }); }); return this; }, applyMask: function(YTPlayer){ var $YTPlayer=jQuery(YTPlayer); $YTPlayer.off("YTPTime.mask"); if(YTPlayer.opt.mask){ if(typeof YTPlayer.opt.mask=="string"){ $YTPlayer.YTPAddMask(YTPlayer.opt.mask); YTPlayer.actualMask=YTPlayer.opt.mask; }else if(typeof YTPlayer.opt.mask=="object"){ for(var time in YTPlayer.opt.mask){ if(YTPlayer.opt.mask[ time ]) var img=jQuery("").attr("src", YTPlayer.opt.mask[ time ]); } if(YTPlayer.opt.mask[ 0 ]) $YTPlayer.YTPAddMask(YTPlayer.opt.mask[ 0 ]); $YTPlayer.on("YTPTime.mask", function(e){ for(var time in YTPlayer.opt.mask){ if(e.time==time) if(!YTPlayer.opt.mask[ time ]){ $YTPlayer.YTPRemoveMask(); }else{ $YTPlayer.YTPAddMask(YTPlayer.opt.mask[ time ]); YTPlayer.actualMask=YTPlayer.opt.mask[ time ]; }} }); }} }, toggleMask: function(){ var YTPlayer=this.get(0); var $YTPlayer=$(YTPlayer); if(YTPlayer.hasMask) $YTPlayer.YTPRemoveMask(); else $YTPlayer.YTPAddMask(); return this; }, manageProgress: function(){ var YTPlayer=this.get(0); var controls=jQuery("#controlBar_" + YTPlayer.id); var progressBar=controls.find(".mb_YTPProgress"); var loadedBar=controls.find(".mb_YTPLoaded"); var timeBar=controls.find(".mb_YTPseekbar"); var totW=progressBar.outerWidth(); var currentTime=Math.floor(YTPlayer.player.getCurrentTime()); var totalTime=Math.floor(YTPlayer.player.getDuration()); var timeW=(currentTime * totW) / totalTime; var startLeft=0; var loadedW=YTPlayer.player.getVideoLoadedFraction() * 100; loadedBar.css({ left: startLeft, width: loadedW + "%" }); timeBar.css({ left: 0, width: timeW }); return { totalTime: totalTime, currentTime: currentTime };}, buildControls: function(YTPlayer){ var data=YTPlayer.opt; data.showYTLogo=data.showYTLogo||data.printUrl; if(jQuery("#controlBar_" + YTPlayer.id).length) return; YTPlayer.controlBar=jQuery("").attr("id", "controlBar_" + YTPlayer.id).addClass("mb_YTPBar").css({ whiteSpace: "noWrap", position: YTPlayer.isBackground ? "fixed":"absolute", zIndex: YTPlayer.isBackground ? 10000:1000 }).hide(); var buttonBar=jQuery("
    ").addClass("buttonBar"); var playpause=jQuery("" + jQuery.mbYTPlayer.controls.play + "").addClass("mb_YTPPlaypause ytpicon").click(function(){ if(YTPlayer.player.getPlayerState()==1) jQuery(YTPlayer).YTPPause(); else jQuery(YTPlayer).YTPPlay(); }); var MuteUnmute=jQuery("" + jQuery.mbYTPlayer.controls.mute + "").addClass("mb_YTPMuteUnmute ytpicon").click(function(){ if(YTPlayer.player.getVolume()==0){ jQuery(YTPlayer).YTPUnmute(); }else{ jQuery(YTPlayer).YTPMute(); }}); var volumeBar=jQuery("
    ").addClass("mb_YTPVolumeBar").css({ display: "inline-block" }); YTPlayer.volumeBar=volumeBar; var idx=jQuery("").addClass("mb_YTPTime"); var vURL=data.videoURL ? data.videoURL:""; if(vURL.indexOf("http") < 0) vURL=jQuery.mbYTPlayer.locationProtocol + "//www.youtube.com/watch?v=" + data.videoURL; var movieUrl=jQuery("").html(jQuery.mbYTPlayer.controls.ytLogo).addClass("mb_YTPUrl ytpicon").attr("title", "view on YouTube").on("click", function(){ window.open(vURL, "viewOnYT") }); var onlyVideo=jQuery("").html(jQuery.mbYTPlayer.controls.onlyYT).addClass("mb_OnlyYT ytpicon").on("click", function(){ jQuery(YTPlayer).YTPFullscreen(data.realfullscreen); }); var progressBar=jQuery("
    ").addClass("mb_YTPProgress").css("position", "absolute").click(function(e){ timeBar.css({ width:(e.clientX - timeBar.offset().left) }); YTPlayer.timeW=e.clientX - timeBar.offset().left; YTPlayer.controlBar.find(".mb_YTPLoaded").css({ width: 0 }); var totalTime=Math.floor(YTPlayer.player.getDuration()); YTPlayer.goto=(timeBar.outerWidth() * totalTime) / progressBar.outerWidth(); YTPlayer.player.seekTo(parseFloat(YTPlayer.goto), true); YTPlayer.controlBar.find(".mb_YTPLoaded").css({ width: 0 }); }); var loadedBar=jQuery("
    ").addClass("mb_YTPLoaded").css("position", "absolute"); var timeBar=jQuery("
    ").addClass("mb_YTPseekbar").css("position", "absolute"); progressBar.append(loadedBar).append(timeBar); buttonBar.append(playpause).append(MuteUnmute).append(volumeBar).append(idx); if(data.showYTLogo){ buttonBar.append(movieUrl); } if(YTPlayer.isBackground||(eval(YTPlayer.opt.realfullscreen)&&!YTPlayer.isBackground)) buttonBar.append(onlyVideo); YTPlayer.controlBar.append(buttonBar).append(progressBar); if(!YTPlayer.isBackground){ YTPlayer.controlBar.addClass("inlinePlayer"); YTPlayer.wrapper.before(YTPlayer.controlBar); }else{ jQuery("body").after(YTPlayer.controlBar); } volumeBar.simpleSlider({ initialval: YTPlayer.opt.vol, scale: 100, orientation: "h", callback: function(el){ if(el.value==0){ jQuery(YTPlayer).YTPMute(); }else{ jQuery(YTPlayer).YTPUnmute(); } YTPlayer.player.setVolume(el.value); if(!YTPlayer.isMute) YTPlayer.opt.vol=el.value; }}); }, checkForState: function(YTPlayer){ var interval=YTPlayer.opt.showControls ? 100:400; clearInterval(YTPlayer.getState); if(!jQuery.contains(document, YTPlayer)){ jQuery(YTPlayer).YTPPlayerDestroy(); clearInterval(YTPlayer.getState); clearInterval(YTPlayer.checkForStartAt); return; } jQuery.mbYTPlayer.checkForStart(YTPlayer); YTPlayer.getState=setInterval(function(){ var prog=jQuery(YTPlayer).YTPManageProgress(); var $YTPlayer=jQuery(YTPlayer); var data=YTPlayer.opt; var startAt=YTPlayer.start_from_last ? YTPlayer.start_from_last:YTPlayer.opt.startAt ? YTPlayer.opt.startAt:1; YTPlayer.start_from_last=null; var stopAt=YTPlayer.opt.stopAt > YTPlayer.opt.startAt ? YTPlayer.opt.stopAt:0; stopAt=stopAt < YTPlayer.player.getDuration() ? stopAt:0; if(YTPlayer.currentTime!=prog.currentTime){ var YTPEvent=jQuery.Event("YTPTime"); YTPEvent.time=YTPlayer.currentTime; jQuery(YTPlayer).trigger(YTPEvent); } YTPlayer.currentTime=prog.currentTime; YTPlayer.totalTime=YTPlayer.player.getDuration(); if(YTPlayer.player.getVolume()==0) $YTPlayer.addClass("isMuted"); else $YTPlayer.removeClass("isMuted"); if(YTPlayer.opt.showControls) if(prog.totalTime){ YTPlayer.controlBar.find(".mb_YTPTime").html(jQuery.mbYTPlayer.formatTime(prog.currentTime) + " / " + jQuery.mbYTPlayer.formatTime(prog.totalTime)); }else{ YTPlayer.controlBar.find(".mb_YTPTime").html("--:-- / --:--"); } if(eval(YTPlayer.opt.stopMovieOnBlur)){ if(!document.hasFocus()){ if(YTPlayer.state==1){ YTPlayer.hasFocus=false; $YTPlayer.YTPPause(); }}else if(document.hasFocus()&&!YTPlayer.hasFocus&&!(YTPlayer.state==-1||YTPlayer.state==0)){ YTPlayer.hasFocus=true; $YTPlayer.YTPPlay(); }} if(YTPlayer.opt.playOnlyIfVisible){ var isOnScreen=jQuery.mbYTPlayer.isOnScreen(YTPlayer); if(!isOnScreen&&YTPlayer.state==1){ YTPlayer.hasFocus=false; $YTPlayer.YTPPause(); console.debug(YTPlayer.id, isOnScreen) console.debug(YTPlayer.state) }else if(!YTPlayer.hasFocus&&!(YTPlayer.state==-1||YTPlayer.state==0)){ YTPlayer.hasFocus=true; $YTPlayer.YTPPlay(); }} if(YTPlayer.controlBar.length&&YTPlayer.controlBar.outerWidth() <=400&&!YTPlayer.isCompact){ YTPlayer.controlBar.addClass("compact"); YTPlayer.isCompact=true; if(!YTPlayer.isMute&&YTPlayer.volumeBar) YTPlayer.volumeBar.updateSliderVal(YTPlayer.opt.vol); }else if(YTPlayer.controlBar.length&&YTPlayer.controlBar.outerWidth() > 400&&YTPlayer.isCompact){ YTPlayer.controlBar.removeClass("compact"); YTPlayer.isCompact=false; if(!YTPlayer.isMute&&YTPlayer.volumeBar) YTPlayer.volumeBar.updateSliderVal(YTPlayer.opt.vol); } if(YTPlayer.player.getPlayerState()==1&&(parseFloat(YTPlayer.player.getDuration() - .5) < YTPlayer.player.getCurrentTime()||(stopAt > 0&&parseFloat(YTPlayer.player.getCurrentTime()) > stopAt))){ if(YTPlayer.isEnded) return; YTPlayer.isEnded=true; setTimeout(function(){ YTPlayer.isEnded=false }, 1000); if(YTPlayer.isPlayList){ if(!data.loop||(data.loop > 0&&YTPlayer.player.loopTime===data.loop - 1)){ YTPlayer.player.loopTime=undefined; clearInterval(YTPlayer.getState); var YTPEnd=jQuery.Event("YTPEnd"); YTPEnd.time=YTPlayer.currentTime; jQuery(YTPlayer).trigger(YTPEnd); return; }}else if(!data.loop||(data.loop > 0&&YTPlayer.player.loopTime===data.loop - 1)){ YTPlayer.player.loopTime=undefined; YTPlayer.preventTrigger=true; YTPlayer.state=2; jQuery(YTPlayer).YTPPause(); YTPlayer.wrapper.CSSAnimate({ opacity: 0 }, YTPlayer.opt.fadeOnStartTime, function(){ if(YTPlayer.controlBar.length) YTPlayer.controlBar.find(".mb_YTPPlaypause").html(jQuery.mbYTPlayer.controls.play); var YTPEnd=jQuery.Event("YTPEnd"); YTPEnd.time=YTPlayer.currentTime; jQuery(YTPlayer).trigger(YTPEnd); YTPlayer.player.seekTo(startAt, true); if(!YTPlayer.isBackground){ if(YTPlayer.opt.backgroundUrl&&YTPlayer.isPlayer){ YTPlayer.opt.backgroundUrl=YTPlayer.opt.backgroundUrl||YTPlayer.orig_background; YTPlayer.opt.containment.css({ background: "url(" + YTPlayer.opt.backgroundUrl + ") center center", backgroundSize: "cover" }); }}else{ if(YTPlayer.orig_background) jQuery(YTPlayer).css("background-image", YTPlayer.orig_background); }}); return; } YTPlayer.player.loopTime=YTPlayer.player.loopTime ? ++YTPlayer.player.loopTime:1; startAt=startAt||1; YTPlayer.preventTrigger=true; YTPlayer.state=2; jQuery(YTPlayer).YTPPause(); YTPlayer.player.seekTo(startAt, true); $YTPlayer.YTPPlay(); }}, interval); }, getTime: function(){ var YTPlayer=this.get(0); return jQuery.mbYTPlayer.formatTime(YTPlayer.currentTime); }, getTotalTime: function(){ var YTPlayer=this.get(0); return jQuery.mbYTPlayer.formatTime(YTPlayer.totalTime); }, checkForStart: function(YTPlayer){ var $YTPlayer=jQuery(YTPlayer); if(!jQuery.contains(document, YTPlayer)){ jQuery(YTPlayer).YTPPlayerDestroy(); return } YTPlayer.preventTrigger=true; YTPlayer.state=2; jQuery(YTPlayer).YTPPause(); jQuery(YTPlayer).muteYTPVolume(); jQuery("#controlBar_" + YTPlayer.id).remove(); YTPlayer.controlBar=false; if(YTPlayer.opt.showControls) jQuery.mbYTPlayer.buildControls(YTPlayer); if(YTPlayer.opt.addRaster){ var classN=YTPlayer.opt.addRaster=="dot" ? "raster-dot":"raster"; YTPlayer.overlay.addClass(YTPlayer.isRetina ? classN + " retina":classN); }else{ YTPlayer.overlay.removeClass(function(index, classNames){ var current_classes=classNames.split(" "), classes_to_remove=[]; jQuery.each(current_classes, function(index, class_name){ if(/raster.*/.test(class_name)){ classes_to_remove.push(class_name); }}); classes_to_remove.push("retina"); return classes_to_remove.join(" "); }) } var startAt=YTPlayer.start_from_last ? YTPlayer.start_from_last:YTPlayer.opt.startAt ? YTPlayer.opt.startAt:1; YTPlayer.start_from_last=null; YTPlayer.player.playVideo(); YTPlayer.player.seekTo(startAt, true); clearInterval(YTPlayer.checkForStartAt); YTPlayer.checkForStartAt=setInterval(function(){ jQuery(YTPlayer).YTPMute(); var canPlayVideo=YTPlayer.player.getVideoLoadedFraction() >=startAt / YTPlayer.player.getDuration(); if(YTPlayer.player.getDuration() > 0&&YTPlayer.player.getCurrentTime() >=startAt&&canPlayVideo){ clearInterval(YTPlayer.checkForStartAt); if(typeof YTPlayer.opt.onReady=="function") YTPlayer.opt.onReady(YTPlayer); YTPlayer.isReady=true; var YTPready=jQuery.Event("YTPReady"); YTPready.time=YTPlayer.currentTime; jQuery(YTPlayer).trigger(YTPready); YTPlayer.preventTrigger=true; YTPlayer.state=2; jQuery(YTPlayer).YTPPause(); if(!YTPlayer.opt.mute) jQuery(YTPlayer).YTPUnmute(); YTPlayer.canTrigger=true; if(YTPlayer.opt.autoPlay){ var YTPStart=jQuery.Event("YTPStart"); YTPStart.time=YTPlayer.currentTime; jQuery(YTPlayer).trigger(YTPStart); jQuery(YTPlayer.playerEl).css({ opacity: 1 }); $YTPlayer.YTPPlay(); YTPlayer.wrapper.css({ opacity: YTPlayer.isAlone ? 1:YTPlayer.opt.opacity }); if(jQuery.mbBrowser.os.name=="mac"&&jQuery.mbBrowser.safari&&jQuery.mbBrowser.versionCompare(jQuery.mbBrowser.fullVersion, "10.1") < 0){ //jQuery.mbBrowser.os.minor_version < 11 YTPlayer.safariPlay=setInterval(function(){ if(YTPlayer.state!=1) $YTPlayer.YTPPlay(); else clearInterval(YTPlayer.safariPlay) }, 10) } $YTPlayer.one("YTPReady", function(){ $YTPlayer.YTPPlay(); }); }else{ YTPlayer.player.pauseVideo(); if(!YTPlayer.isPlayer){ jQuery(YTPlayer.playerEl).css({ opacity: 1 }); YTPlayer.wrapper.css({ opacity: YTPlayer.isAlone ? 1:YTPlayer.opt.opacity }); } if(YTPlayer.controlBar.length) YTPlayer.controlBar.find(".mb_YTPPlaypause").html(jQuery.mbYTPlayer.controls.play); } if(YTPlayer.isPlayer&&!YTPlayer.opt.autoPlay&&(YTPlayer.loading&&YTPlayer.loading.length)){ YTPlayer.loading.html("Ready"); setTimeout(function(){ YTPlayer.loading.fadeOut(); }, 100) } if(YTPlayer.controlBar&&YTPlayer.controlBar.length) YTPlayer.controlBar.slideDown(1000); }else if(jQuery.mbBrowser.os.name=="mac"&&jQuery.mbBrowser.safari&&jQuery.mbBrowser.fullVersion&&jQuery.mbBrowser.versionCompare(jQuery.mbBrowser.fullVersion, "10.1") < 0){ //jQuery.mbBrowser.os.minor_version < 11 YTPlayer.player.playVideo(); if(startAt >=0) YTPlayer.player.seekTo(startAt, true); }}, 10); }, setAnchor: function(anchor){ var $YTplayer=this; $YTplayer.optimizeDisplay(anchor); }, getAnchor: function(){ var YTPlayer=this.get(0); return YTPlayer.opt.anchor; }, formatTime: function(s){ var min=Math.floor(s / 60); var sec=Math.floor(s -(60 * min)); return(min <=9 ? "0" + min:min) + ":" +(sec <=9 ? "0" + sec:sec); }}; jQuery.fn.optimizeDisplay=function(anchor){ var YTPlayer=this.get(0); var playerBox=jQuery(YTPlayer.playerEl); var vid={}; YTPlayer.opt.anchor=anchor||YTPlayer.opt.anchor; YTPlayer.opt.anchor=typeof YTPlayer.opt.anchor!="undefined " ? YTPlayer.opt.anchor:"center,center"; var YTPAlign=YTPlayer.opt.anchor.split(","); if(YTPlayer.opt.optimizeDisplay){ var abundance=YTPlayer.isPlayer ? 0:80; var win={}; var el=YTPlayer.wrapper; win.width=el.outerWidth(); win.height=el.outerHeight() + abundance; YTPlayer.opt.ratio=eval(YTPlayer.opt.ratio); vid.width=win.width; vid.height=Math.ceil(vid.width / YTPlayer.opt.ratio); vid.marginTop=Math.ceil(-(( vid.height - win.height) / 2)); vid.marginLeft=0; var lowest=vid.height < win.height; if(lowest){ vid.height=win.height; vid.width=Math.ceil(vid.height * YTPlayer.opt.ratio); vid.marginTop=0; vid.marginLeft=Math.ceil(-(( vid.width - win.width) / 2)); } for(var a in YTPAlign){ if(YTPAlign.hasOwnProperty(a)){ var al=YTPAlign[ a ].replace(/ /g, ""); switch(al){ case "top": vid.marginTop=lowest ? -(( vid.height - win.height) / 2):0; break; case "bottom": vid.marginTop=lowest ? 0:-(vid.height -(win.height)); break; case "left": vid.marginLeft=0; break; case "right": vid.marginLeft=lowest ? -(vid.width - win.width):0; break; default: if(vid.width > win.width) vid.marginLeft=-(( vid.width - win.width) / 2); break; }} }}else{ vid.width="100%"; vid.height="100%"; vid.marginTop=0; vid.marginLeft=0; } playerBox.css({ width: vid.width, height: vid.height, marginTop: vid.marginTop, marginLeft: vid.marginLeft, maxWidth: "initial" }); }; jQuery.shuffle=function(arr){ var newArray=arr.slice(); var len=newArray.length; var i=len; while(i--){ var p=parseInt(Math.random() * len); var t=newArray[ i ]; newArray[ i ]=newArray[ p ]; newArray[ p ]=t; } return newArray; }; jQuery.fn.unselectable=function(){ return this.each(function(){ jQuery(this).css({ "-moz-user-select": "none", "-webkit-user-select": "none", "user-select": "none" }).attr("unselectable", "on"); }); }; jQuery.fn.YTPlayer=jQuery.mbYTPlayer.buildPlayer; jQuery.fn.YTPGetPlayer=jQuery.mbYTPlayer.getPlayer; jQuery.fn.YTPGetVideoID=jQuery.mbYTPlayer.getVideoID; jQuery.fn.YTPChangeMovie=jQuery.mbYTPlayer.changeMovie; jQuery.fn.YTPPlayerDestroy=jQuery.mbYTPlayer.playerDestroy; jQuery.fn.YTPPlay=jQuery.mbYTPlayer.play; jQuery.fn.YTPTogglePlay=jQuery.mbYTPlayer.togglePlay; jQuery.fn.YTPStop=jQuery.mbYTPlayer.stop; jQuery.fn.YTPPause=jQuery.mbYTPlayer.pause; jQuery.fn.YTPSeekTo=jQuery.mbYTPlayer.seekTo; jQuery.fn.YTPlaylist=jQuery.mbYTPlayer.playlist; jQuery.fn.YTPPlayNext=jQuery.mbYTPlayer.playNext; jQuery.fn.YTPPlayPrev=jQuery.mbYTPlayer.playPrev; jQuery.fn.YTPPlayIndex=jQuery.mbYTPlayer.playIndex; jQuery.fn.YTPMute=jQuery.mbYTPlayer.mute; jQuery.fn.YTPUnmute=jQuery.mbYTPlayer.unmute; jQuery.fn.YTPToggleVolume=jQuery.mbYTPlayer.toggleVolume; jQuery.fn.YTPSetVolume=jQuery.mbYTPlayer.setVolume; jQuery.fn.YTPGetVideoData=jQuery.mbYTPlayer.getVideoData; jQuery.fn.YTPFullscreen=jQuery.mbYTPlayer.fullscreen; jQuery.fn.YTPToggleLoops=jQuery.mbYTPlayer.toggleLoops; jQuery.fn.YTPSetVideoQuality=jQuery.mbYTPlayer.setVideoQuality; jQuery.fn.YTPManageProgress=jQuery.mbYTPlayer.manageProgress; jQuery.fn.YTPApplyFilter=jQuery.mbYTPlayer.applyFilter; jQuery.fn.YTPApplyFilters=jQuery.mbYTPlayer.applyFilters; jQuery.fn.YTPToggleFilter=jQuery.mbYTPlayer.toggleFilter; jQuery.fn.YTPToggleFilters=jQuery.mbYTPlayer.toggleFilters; jQuery.fn.YTPRemoveFilter=jQuery.mbYTPlayer.removeFilter; jQuery.fn.YTPDisableFilters=jQuery.mbYTPlayer.disableFilters; jQuery.fn.YTPEnableFilters=jQuery.mbYTPlayer.enableFilters; jQuery.fn.YTPGetFilters=jQuery.mbYTPlayer.getFilters; jQuery.fn.YTPGetTime=jQuery.mbYTPlayer.getTime; jQuery.fn.YTPGetTotalTime=jQuery.mbYTPlayer.getTotalTime; jQuery.fn.YTPAddMask=jQuery.mbYTPlayer.addMask; jQuery.fn.YTPRemoveMask=jQuery.mbYTPlayer.removeMask; jQuery.fn.YTPToggleMask=jQuery.mbYTPlayer.toggleMask; jQuery.fn.YTPSetAnchor=jQuery.mbYTPlayer.setAnchor; jQuery.fn.YTPGetAnchor=jQuery.mbYTPlayer.getAnchor; jQuery.fn.mb_YTPlayer=jQuery.mbYTPlayer.buildPlayer; jQuery.fn.playNext=jQuery.mbYTPlayer.playNext; jQuery.fn.playPrev=jQuery.mbYTPlayer.playPrev; jQuery.fn.changeMovie=jQuery.mbYTPlayer.changeMovie; jQuery.fn.getVideoID=jQuery.mbYTPlayer.getVideoID; jQuery.fn.getPlayer=jQuery.mbYTPlayer.getPlayer; jQuery.fn.playerDestroy=jQuery.mbYTPlayer.playerDestroy; jQuery.fn.fullscreen=jQuery.mbYTPlayer.fullscreen; jQuery.fn.buildYTPControls=jQuery.mbYTPlayer.buildControls; jQuery.fn.playYTP=jQuery.mbYTPlayer.play; jQuery.fn.toggleLoops=jQuery.mbYTPlayer.toggleLoops; jQuery.fn.stopYTP=jQuery.mbYTPlayer.stop; jQuery.fn.pauseYTP=jQuery.mbYTPlayer.pause; jQuery.fn.seekToYTP=jQuery.mbYTPlayer.seekTo; jQuery.fn.muteYTPVolume=jQuery.mbYTPlayer.mute; jQuery.fn.unmuteYTPVolume=jQuery.mbYTPlayer.unmute; jQuery.fn.setYTPVolume=jQuery.mbYTPlayer.setVolume; jQuery.fn.setVideoQuality=jQuery.mbYTPlayer.setVideoQuality; jQuery.fn.manageYTPProgress=jQuery.mbYTPlayer.manageProgress; jQuery.fn.YTPGetDataFromFeed=jQuery.mbYTPlayer.getVideoData; })(jQuery, ytp); ; function uncamel(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}function setUnit(e,t){return"string"!=typeof e||e.match(/^[\-0-9\.]+jQuery/)?""+e+t:e}function setFilter(e,t,r){var i=uncamel(t),n=jQuery.browser.mozilla?"":jQuery.CSS.sfx;e[n+"filter"]=e[n+"filter"]||"",r=setUnit(r>jQuery.CSS.filters[t].max?jQuery.CSS.filters[t].max:r,jQuery.CSS.filters[t].unit),e[n+"filter"]+=i+"("+r+") ",delete e[t]}jQuery.support.CSStransition=function(){var e=document.body||document.documentElement,t=e.style;return void 0!==t.transition||void 0!==t.WebkitTransition||void 0!==t.MozTransition||void 0!==t.MsTransition||void 0!==t.OTransition}(),jQuery.CSS={name:"mb.CSSAnimate",author:"Matteo Bicocchi",version:"2.0.0",transitionEnd:"transitionEnd",sfx:"",filters:{blur:{min:0,max:100,unit:"px"},brightness:{min:0,max:400,unit:"%"},contrast:{min:0,max:400,unit:"%"},grayscale:{min:0,max:100,unit:"%"},hueRotate:{min:0,max:360,unit:"deg"},invert:{min:0,max:100,unit:"%"},saturate:{min:0,max:400,unit:"%"},sepia:{min:0,max:100,unit:"%"}},normalizeCss:function(e){var t=jQuery.extend(!0,{},e);jQuery.browser.webkit||jQuery.browser.opera?jQuery.CSS.sfx="-webkit-":jQuery.browser.mozilla?jQuery.CSS.sfx="-moz-":jQuery.browser.msie&&(jQuery.CSS.sfx="-ms-");for(var r in t){"transform"===r&&(t[jQuery.CSS.sfx+"transform"]=t[r],delete t[r]),"transform-origin"===r&&(t[jQuery.CSS.sfx+"transform-origin"]=e[r],delete t[r]),"filter"!==r||jQuery.browser.mozilla||(t[jQuery.CSS.sfx+"filter"]=e[r],delete t[r]),"blur"===r&&setFilter(t,"blur",e[r]),"brightness"===r&&setFilter(t,"brightness",e[r]),"contrast"===r&&setFilter(t,"contrast",e[r]),"grayscale"===r&&setFilter(t,"grayscale",e[r]),"hueRotate"===r&&setFilter(t,"hueRotate",e[r]),"invert"===r&&setFilter(t,"invert",e[r]),"saturate"===r&&setFilter(t,"saturate",e[r]),"sepia"===r&&setFilter(t,"sepia",e[r]);var i="";"x"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" translateX("+setUnit(e[r],"px")+")",delete t[r]),"y"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" translateY("+setUnit(e[r],"px")+")",delete t[r]),"z"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" translateZ("+setUnit(e[r],"px")+")",delete t[r]),"rotate"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" rotate("+setUnit(e[r],"deg")+")",delete t[r]),"rotateX"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" rotateX("+setUnit(e[r],"deg")+")",delete t[r]),"rotateY"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" rotateY("+setUnit(e[r],"deg")+")",delete t[r]),"rotateZ"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" rotateZ("+setUnit(e[r],"deg")+")",delete t[r]),"scale"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" scale("+setUnit(e[r],"")+")",delete t[r]),"scaleX"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" scaleX("+setUnit(e[r],"")+")",delete t[r]),"scaleY"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" scaleY("+setUnit(e[r],"")+")",delete t[r]),"scaleZ"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" scaleZ("+setUnit(e[r],"")+")",delete t[r]),"skew"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" skew("+setUnit(e[r],"deg")+")",delete t[r]),"skewX"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" skewX("+setUnit(e[r],"deg")+")",delete t[r]),"skewY"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" skewY("+setUnit(e[r],"deg")+")",delete t[r]),"perspective"===r&&(i=jQuery.CSS.sfx+"transform",t[i]=t[i]||"",t[i]+=" perspective("+setUnit(e[r],"px")+")",delete t[r])}return t},getProp:function(e){var t=[];for(var r in e)t.indexOf(r)<0&&t.push(uncamel(r));return t.join(",")},animate:function(e,t,r,i,n){return this.each(function(){function s(){u.called=!0,u.CSSAIsRunning=!1,a.off(jQuery.CSS.transitionEnd+"."+u.id),clearTimeout(u.timeout),a.css(jQuery.CSS.sfx+"transition",""),"function"==typeof n&&n.apply(u),"function"==typeof u.CSSqueue&&(u.CSSqueue(),u.CSSqueue=null)}var u=this,a=jQuery(this);u.id=u.id||"CSSA_"+(new Date).getTime();var o=o||{type:"noEvent"};if(u.CSSAIsRunning&&u.eventType==o.type&&!jQuery.browser.msie&&jQuery.browser.version<=9)return void(u.CSSqueue=function(){a.CSSAnimate(e,t,r,i,n)});if(u.CSSqueue=null,u.eventType=o.type,0!==a.length&&e){if(e=jQuery.normalizeCss(e),u.CSSAIsRunning=!0,"function"==typeof t&&(n=t,t=jQuery.fx.speeds._default),"function"==typeof r&&(i=r,r=0),"string"==typeof r&&(n=r,r=0),"function"==typeof i&&(n=i,i="cubic-bezier(0.65,0.03,0.36,0.72)"),"string"==typeof t)for(var f in jQuery.fx.speeds){if(t==f){t=jQuery.fx.speeds[f];break}t=jQuery.fx.speeds._default}if(t||(t=jQuery.fx.speeds._default),"string"==typeof n&&(i=n,n=null),!jQuery.support.CSStransition){for(var c in e){if("transform"===c&&delete e[c],"filter"===c&&delete e[c],"transform-origin"===c&&delete e[c],"auto"===e[c]&&delete e[c],"x"===c){var S=e[c],l="left";e[l]=S,delete e[c]}if("y"===c){var S=e[c],l="top";e[l]=S,delete e[c]}("-ms-transform"===c||"-ms-filter"===c)&&delete e[c]}return void a.delay(r).animate(e,t,n)}var y={"default":"ease","in":"ease-in",out:"ease-out","in-out":"ease-in-out",snap:"cubic-bezier(0,1,.5,1)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"};y[i]&&(i=y[i]),a.off(jQuery.CSS.transitionEnd+"."+u.id);var m=jQuery.CSS.getProp(e),d={};jQuery.extend(d,e),d[jQuery.CSS.sfx+"transition-property"]=m,d[jQuery.CSS.sfx+"transition-duration"]=t+"ms",d[jQuery.CSS.sfx+"transition-delay"]=r+"ms",d[jQuery.CSS.sfx+"transition-timing-function"]=i,setTimeout(function(){a.one(jQuery.CSS.transitionEnd+"."+u.id,s),a.css(d)},1),u.timeout=setTimeout(function(){return u.called||!n?(u.called=!1,void(u.CSSAIsRunning=!1)):(a.css(jQuery.CSS.sfx+"transition",""),n.apply(u),u.CSSAIsRunning=!1,void("function"==typeof u.CSSqueue&&(u.CSSqueue(),u.CSSqueue=null)))},t+r+10)}})}},jQuery.fn.CSSAnimate=jQuery.CSS.animate,jQuery.normalizeCss=jQuery.CSS.normalizeCss,jQuery.fn.css3=function(e){return this.each(function(){var t=jQuery(this),r=jQuery.normalizeCss(e);t.css(r)})}; ; var nAgt=navigator.userAgent;jQuery.browser=jQuery.browser||{};jQuery.browser.mozilla=!1;jQuery.browser.webkit=!1;jQuery.browser.opera=!1;jQuery.browser.safari=!1;jQuery.browser.chrome=!1;jQuery.browser.androidStock=!1;jQuery.browser.msie=!1;jQuery.browser.edge=!1;jQuery.browser.ua=nAgt;function isTouchSupported(){var a=nAgt.msMaxTouchPoints,e="ontouchstart"in document.createElement("div");return a||e?!0:!1} var getOS=function(){var a={version:"Unknown version",name:"Unknown OS"};-1!=navigator.appVersion.indexOf("Win")&&(a.name="Windows");-1!=navigator.appVersion.indexOf("Mac")&&0>navigator.appVersion.indexOf("Mobile")&&(a.name="Mac");-1!=navigator.appVersion.indexOf("Linux")&&(a.name="Linux");/Mac OS X/.test(nAgt)&&!/Mobile/.test(nAgt)&&(a.version=/Mac OS X (10[\.\_\d]+)/.exec(nAgt)[1],a.version=a.version.replace(/_/g,".").substring(0,5));/Windows/.test(nAgt)&&(a.version="Unknown.Unknown");/Windows NT 5.1/.test(nAgt)&& (a.version="5.1");/Windows NT 6.0/.test(nAgt)&&(a.version="6.0");/Windows NT 6.1/.test(nAgt)&&(a.version="6.1");/Windows NT 6.2/.test(nAgt)&&(a.version="6.2");/Windows NT 10.0/.test(nAgt)&&(a.version="10.0");/Linux/.test(nAgt)&&/Linux/.test(nAgt)&&(a.version="Unknown.Unknown");a.name=a.name.toLowerCase();a.major_version="Unknown";a.minor_version="Unknown";"Unknown.Unknown"!=a.version&&(a.major_version=parseFloat(a.version.split(".")[0]),a.minor_version=parseFloat(a.version.split(".")[1]));return a}; jQuery.browser.os=getOS();jQuery.browser.hasTouch=isTouchSupported();jQuery.browser.name=navigator.appName;jQuery.browser.fullVersion=""+parseFloat(navigator.appVersion);jQuery.browser.majorVersion=parseInt(navigator.appVersion,10);var nameOffset,verOffset,ix; if(-1!=(verOffset=nAgt.indexOf("Opera")))jQuery.browser.opera=!0,jQuery.browser.name="Opera",jQuery.browser.fullVersion=nAgt.substring(verOffset+6),-1!=(verOffset=nAgt.indexOf("Version"))&&(jQuery.browser.fullVersion=nAgt.substring(verOffset+8));else if(-1!=(verOffset=nAgt.indexOf("OPR")))jQuery.browser.opera=!0,jQuery.browser.name="Opera",jQuery.browser.fullVersion=nAgt.substring(verOffset+4);else if(-1!=(verOffset=nAgt.indexOf("MSIE")))jQuery.browser.msie=!0,jQuery.browser.name="Microsoft Internet Explorer", jQuery.browser.fullVersion=nAgt.substring(verOffset+5);else if(-1!=nAgt.indexOf("Trident")){jQuery.browser.msie=!0;jQuery.browser.name="Microsoft Internet Explorer";var start=nAgt.indexOf("rv:")+3,end=start+4;jQuery.browser.fullVersion=nAgt.substring(start,end)}else-1!=(verOffset=nAgt.indexOf("Edge"))?(jQuery.browser.edge=!0,jQuery.browser.name="Microsoft Edge",jQuery.browser.fullVersion=nAgt.substring(verOffset+5)):-1!=(verOffset=nAgt.indexOf("Chrome"))?(jQuery.browser.webkit=!0,jQuery.browser.chrome= !0,jQuery.browser.name="Chrome",jQuery.browser.fullVersion=nAgt.substring(verOffset+7)):-1parseInt(d[b]))return 1;if(d[b]&&!c[b]&&0").addClass("level").addClass(e); d.prepend(e);a.level=e;d.css({cursor:"default"});"auto"==a.opt.scale&&(a.opt.scale=b(a).outerWidth());d.updateSliderVal();a.opt.readonly||(d.on(b.simpleSlider.events.start,function(c){b.browser.mobile&&(c=c.changedTouches[0]);a.canSlide=!0;d.updateSliderVal(c);"h"==a.opt.orientation?d.css({cursor:"col-resize"}):d.css({cursor:"row-resize"});c.preventDefault();c.stopPropagation()}),b(document).on(b.simpleSlider.events.move,function(c){b.browser.mobile&&(c=c.changedTouches[0]);a.canSlide&&(b(document).css({cursor:"default"}), d.updateSliderVal(c),c.preventDefault(),c.stopPropagation())}).on(b.simpleSlider.events.end,function(){b(document).css({cursor:"auto"});a.canSlide=!1;d.css({cursor:"auto"})}))})},updateSliderVal:function(c){var a=this.get(0);if(a.opt){a.opt.initialval="number"==typeof a.opt.initialval?a.opt.initialval:a.opt.initialval(a);var d=b(a).outerWidth(),e=b(a).outerHeight();a.x="object"==typeof c?c.clientX+document.body.scrollLeft-this.offset().left:"number"==typeof c?c*d/a.opt.scale:a.opt.initialval*d/a.opt.scale; a.y="object"==typeof c?c.clientY+document.body.scrollTop-this.offset().top:"number"==typeof c?(a.opt.scale-a.opt.initialval-c)*e/a.opt.scale:a.opt.initialval*e/a.opt.scale;a.y=this.outerHeight()-a.y;a.scaleX=a.x*a.opt.scale/d;a.scaleY=a.y*a.opt.scale/e;a.outOfRangeX=a.scaleX>a.opt.scale?a.scaleX-a.opt.scale:0>a.scaleX?a.scaleX:0;a.outOfRangeY=a.scaleY>a.opt.scale?a.scaleY-a.opt.scale:0>a.scaleY?a.scaleY:0;a.outOfRange="h"==a.opt.orientation?a.outOfRangeX:a.outOfRangeY;a.value="undefined"!=typeof c? "h"==a.opt.orientation?a.x>=this.outerWidth()?a.opt.scale:0>=a.x?0:a.scaleX:a.y>=this.outerHeight()?a.opt.scale:0>=a.y?0:a.scaleY:"h"==a.opt.orientation?a.scaleX:a.scaleY;"h"==a.opt.orientation?a.level.width(Math.floor(100*a.x/d)+"%"):a.level.height(Math.floor(100*a.y/e));"function"==typeof a.opt.callback&&a.opt.callback(a)}}};b.fn.simpleSlider=b.simpleSlider.init;b.fn.updateSliderVal=b.simpleSlider.updateSliderVal})(jQuery); ; (function(d){d.mbCookie={set:function(a,c,f,b){"object"==typeof c&&(c=JSON.stringify(c));b=b?"; domain="+b:"";var e=new Date,d="";0this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.4",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.4",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport),this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-mp.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.4",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.4",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.4",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a(document.body).height();"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); ;(function($, window, document, undefined){ var OnePageNav=function(elem, options){ this.elem=elem; this.$elem=$(elem); this.options=options; this.metadata=this.$elem.data('plugin-options'); this.$win=$(window); this.sections={}; this.didScroll=false; this.$doc=$(document); this.docHeight=this.$doc.height(); }; var firstItem=true; OnePageNav.prototype={ defaults: { navItems: 'a', currentClass: 'current', changeHash: false, easing: 'swing', filter: '', scrollSpeed: 750, scrollThreshold: 0.5, begin: false, end: false, scrollChange: false }, init: function(){ this.config=$.extend({}, this.defaults, this.options, this.metadata); this.$nav=this.$elem.find(this.config.navItems); if(this.config.filter!==''){ this.$nav=this.$nav.filter(this.config.filter); } this.$nav.on('click.onePageNav', $.proxy(this.handleClick, this)); this.getPositions(); this.bindInterval(); this.$win.on('resize.onePageNav', $.proxy(this.getPositions, this)); return this; }, adjustNav: function(self, $parent){ $('.site-nav li').removeClass(self.config.currentClass); self.$elem.find('.' + self.config.currentClass).removeClass(self.config.currentClass); $parent.addClass(self.config.currentClass); var sectionLoc=$parent.find('a').attr('href'); if(typeof sectionLoc!='undefined'&§ionLoc!=''){ var menuColor=$(sectionLoc).data('menucolor'); if(menuColor==''){ menuColor=$('article.homepage').data('menucolor'); if(typeof menuColor=='undefined'||sectionLoc==''){ menuColor='#ffffff'; }} $('ul.onetone-dots li a').css({'border':'2px solid '+menuColor}); $('ul.onetone-dots li.'+self.config.currentClass+' a,ul.onetone-dots li.'+self.config.currentClass+' a:hover').css({'background-color':menuColor,'color':menuColor}); }}, bindInterval: function(){ var self=this; var docHeight; self.$win.on('scroll.onePageNav', function(){ self.didScroll=true; }); self.t=setInterval(function(){ docHeight=self.$doc.height(); if(self.didScroll){ self.didScroll=false; self.scrollChange(); } if(docHeight!==self.docHeight){ self.docHeight=docHeight; self.getPositions(); }}, 250); }, getHash: function($link){ return $link.attr('href').split('#')[1]; }, getPositions: function(){ var self=this; var linkHref; var topPos; var $target; self.$nav.each(function(){ linkHref=self.getHash($(this)); $target=$('#' + linkHref); if($target.length){ topPos=$target.offset().top; self.sections[linkHref]=Math.round(topPos); }}); }, getSection: function(windowPos){ var returnValue=null; var windowHeight=Math.round(this.$win.height() * this.config.scrollThreshold); for(var section in this.sections){ if((this.sections[section] - windowHeight) < windowPos){ returnValue=section; }} return returnValue; }, handleClick: function(e){ var self=this; var $link=$(e.currentTarget); var $parent=$link.parent(); var newLoc='#' + self.getHash($link); if($("header").hasClass("fixed-header")){ firstItem=false; } var windowWidth=jQuery(window).width(); if(windowWidth < 919) $(".top-nav").toggle(); if(!$parent.hasClass(self.config.currentClass)){ if(self.config.begin){ self.config.begin(); } $parent=$('a[href$="'+ newLoc + '"]').parent(); self.adjustNav(self, $parent); self.unbindInterval(); self.scrollTo(newLoc, function(){ if(self.config.changeHash){ window.location.hash=newLoc; } self.bindInterval(); if(self.config.end){ self.config.end(); }}); } e.preventDefault(); }, scrollChange: function(){ var windowTop=this.$win.scrollTop(); var position=this.getSection(windowTop); var $parent; $('.main-nav li').removeClass(this.config.currentClass); if(position!==null){ $parent=this.$elem.find('a[href$="#' + position + '"]').parent(); if(!$parent.hasClass(this.config.currentClass)){ $parent=$('a[href$="#' + position + '"]').parent(); this.adjustNav(this, $parent); if(this.config.scrollChange){ this.config.scrollChange($parent); }} }}, scrollTo: function(target, callback){ if(typeof $(target).offset()!=="undefined"){ var offset=$(target).offset().top; var selectorHeight=$('.sticky-header').height(); var selectorHeight=$('.fxd-header').height(); if($("body.admin-bar").length){ if(jQuery(window).width() < 765){ stickyTop=46; }else{ stickyTop=32; }}else{ stickyTop=0; } selectorHeight=selectorHeight + stickyTop - 1; if($(window).width() <=919){ $(".site-nav").hide(); } offset=offset - selectorHeight; $('html, body').animate({ scrollTop: offset }, this.config.scrollSpeed, this.config.easing, callback); }}, unbindInterval: function(){ clearInterval(this.t); this.$win.unbind('scroll.onePageNav'); }}; OnePageNav.defaults=OnePageNav.prototype.defaults; $.fn.onePageNav=function(options){ return this.each(function(){ new OnePageNav(this, options).init(); }); };})(jQuery, window , document); ;(function (define){ 'use strict'; define(['jquery'], function ($){ var $scrollTo=$.scrollTo=function(target, duration, settings){ return $(window).scrollTo(target, duration, settings); }; $scrollTo.defaults={ axis:'xy', duration: 0, limit:true }; $scrollTo.window=function(scope){ return $(window)._scrollable(); }; $.fn._scrollable=function(){ return this.map(function(){ var elem=this, isWin = !elem.nodeName||$.inArray(elem.nodeName.toLowerCase(), ['iframe','#document','html','body'])!=-1; if(!isWin) return elem; var doc=(elem.contentWindow||elem).document||elem.ownerDocument||elem; return /webkit/i.test(navigator.userAgent)||doc.compatMode=='BackCompat' ? doc.body : doc.documentElement; }); }; $.fn.scrollTo=function(target, duration, settings){ if(typeof duration=='object'){ settings=duration; duration=0; } if(typeof settings=='function') settings={ onAfter:settings }; if(target=='max') target=9e9; settings=$.extend({}, $scrollTo.defaults, settings); duration=duration||settings.duration; settings.queue=settings.queue&&settings.axis.length > 1; if(settings.queue) duration /=2; settings.offset=both(settings.offset); settings.over=both(settings.over); return this._scrollable().each(function(){ if(target==null) return; var elem=this, $elem=$(elem), targ=target, toff, attr={}, win=$elem.is('html,body'); switch (typeof targ){ case 'number': case 'string': if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){ targ=both(targ); break; } targ=win ? $(targ):$(targ, this); if(!targ.length) return; case 'object': if(targ.is||targ.style) toff=(targ=$(targ)).offset(); } var offset=$.isFunction(settings.offset)&&settings.offset(elem, targ)||settings.offset; $.each(settings.axis.split(''), function(i, axis){ var Pos=axis=='x' ? 'Left':'Top', pos=Pos.toLowerCase(), key='scroll' + Pos, old=elem[key], max=$scrollTo.max(elem, axis); if(toff){ attr[key]=toff[pos] +(win ? 0:old - $elem.offset()[pos]); if(settings.margin){ attr[key] -=parseInt(targ.css('margin'+Pos))||0; attr[key] -=parseInt(targ.css('border'+Pos+'Width'))||0; } attr[key] +=offset[pos]||0; if(settings.over[pos]) attr[key] +=targ[axis=='x'?'width':'height']() * settings.over[pos]; }else{ var val=targ[pos]; attr[key]=val.slice&&val.slice(-1)=='%' ? parseFloat(val) / 100 * max : val; } if(settings.limit&&/^\d+$/.test(attr[key])) attr[key]=attr[key] <=0 ? 0:Math.min(attr[key], max); if(!i&&settings.queue){ if(old!=attr[key]) animate(settings.onAfterFirst); delete attr[key]; }}); animate(settings.onAfter); function animate(callback){ $elem.animate(attr, duration, settings.easing, callback&&function(){ callback.call(this, targ, settings); }); }}).end(); }; $scrollTo.max=function(elem, axis){ var Dim=axis=='x' ? 'Width':'Height', scroll='scroll'+Dim; if(!$(elem).is('html,body')) return elem[scroll] - $(elem)[Dim.toLowerCase()](); var size='client' + Dim, html=elem.ownerDocument.documentElement, body=elem.ownerDocument.body; return Math.max(html[scroll], body[scroll]) - Math.min(html[size] , body[size]); }; function both(val){ return $.isFunction(val)||$.isPlainObject(val) ? val:{ top:val, left:val };} return $scrollTo; }) }(typeof define==='function'&&define.amd ? define:function (deps, factory){ if(typeof module!=='undefined'&&module.exports){ module.exports=factory(require('jquery')); }else{ factory(jQuery); }})); (function($){ var $window=$(window); var windowHeight=$window.height(); $window.resize(function (){ windowHeight=$window.height(); }); $.fn.parallax=function(xpos, speedFactor, outerHeight){ var $this=$(this); var getHeight; var firstTop; var paddingTop=0; $this.each(function(){ firstTop=$this.offset().top; }); if(outerHeight){ getHeight=function(jqo){ return jqo.outerHeight(true); };}else{ getHeight=function(jqo){ return jqo.height(); };} if(arguments.length < 1||xpos===null) xpos="50%"; if(arguments.length < 2||speedFactor===null) speedFactor=0.1; if(arguments.length < 3||outerHeight===null) outerHeight=true; function update(){ var pos=$window.scrollTop(); $this.each(function(){ var $element=$(this); var top=$element.offset().top; var height=getHeight($element); if(top + height < pos||top > pos + windowHeight){ return; } $this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px"); }); } $window.bind('scroll', update).resize(update); update(); };})(jQuery); window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.documentElement,e=d.firstElementChild||d.firstChild,f=a.createElement("body"),g=a.createElement("div");return g.id="mq-test-1",g.style.cssText="position:absolute;top:-100em",f.style.background="none",f.appendChild(g),function(a){return g.innerHTML='­',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document); (function(a){"use strict";function x(){u(!0)}var b={};if(a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,!b.mediaQueriesSupported){var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var b=m.shift();v(b.href,function(c){p(c,b.href,b.media),h[b.href]=!0,a.setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(b){var h="clientWidth",k=d[h],m="CSS1Compat"===c.compatMode&&k||c.body[h]||k,n={},o=l[l.length-1],p=(new Date).getTime();if(b&&q&&i>p-q)return a.clearTimeout(r),r=a.setTimeout(u,i),void 0;q=p;for(var v in e)if(e.hasOwnProperty(v)){var w=e[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?t||s():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?t||s():1)),w.hasquery&&(z&&A||!(z||m>=x)||!(A||y>=m))||(n[w.media]||(n[w.media]=[]),n[w.media].push(f[w.rules]))}for(var C in g)g.hasOwnProperty(C)&&g[C]&&g[C].parentNode===j&&j.removeChild(g[C]);for(var D in n)if(n.hasOwnProperty(D)){var E=c.createElement("style"),F=n[D].join("\n");E.type="text/css",E.media=D,j.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(c.createTextNode(F)),g.push(E)}},v=function(a,b){var c=w();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)}})(this); (function(e){function t(){var e=location.href;hashtag=e.indexOf("#prettyPhoto")!==-1?decodeURI(e.substring(e.indexOf("#prettyPhoto")+1,e.length)):false;return hashtag}function n(){if(typeof theRel=="undefined")return;location.hash=theRel+"/"+rel_index+"/"}function r(){if(location.href.indexOf("#prettyPhoto")!==-1)location.hash="prettyPhoto"}function i(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n="[\\?&]"+e+"=([^&#]*)";var r=new RegExp(n);var i=r.exec(t);return i==null?"":i[1]}e.prettyPhoto={version:"3.1.5"};e.fn.prettyPhoto=function(s){function g(){e(".pp_loaderIcon").hide();projectedTop=scroll_pos["scrollTop"]+(d/2-a["containerHeight"]/2);if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find(".pp_content").animate({height:a["contentHeight"],width:a["contentWidth"]},settings.animation_speed);$pp_pic_holder.animate({top:projectedTop,left:v/2-a["containerWidth"]/2<0?0:v/2-a["containerWidth"]/2,width:a["containerWidth"]},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(a["height"]).width(a["width"]);$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);if(isSet&&S(pp_images[set_position])=="image"){$pp_pic_holder.find(".pp_hoverContainer").show()}else{$pp_pic_holder.find(".pp_hoverContainer").hide()}if(settings.allow_expand){if(a["resized"]){e("a.pp_expand,a.pp_contract").show()}else{e("a.pp_expand").hide()}}if(settings.autoplay_slideshow&&!m&&!f)e.prettyPhoto.startSlideshow();settings.changepicturecallback();f=true});C();s.ajaxcallback()}function y(t){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden");$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){e(".pp_loaderIcon").show();t()})}function b(t){t>1?e(".pp_nav").show():e(".pp_nav").hide()}function w(e,t){resized=false;E(e,t);imageWidth=e,imageHeight=t;if((p>v||h>d)&&doresize&&settings.allow_resize&&!u){resized=true,fitting=false;while(!fitting){if(p>v){imageWidth=v-200;imageHeight=t/e*imageWidth}else if(h>d){imageHeight=d-200;imageWidth=e/t*imageHeight}else{fitting=true}h=imageHeight,p=imageWidth}if(p>v||h>d){w(p,h)}E(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(h),containerWidth:Math.floor(p)+settings.horizontal_padding*2,contentHeight:Math.floor(l),contentWidth:Math.floor(c),resized:resized}}function E(t,n){t=parseFloat(t);n=parseFloat(n);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(t);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({position:"absolute",top:-1e4});detailsHeight+=$pp_details.height();detailsHeight=detailsHeight<=34?36:detailsHeight;$pp_details.remove();$pp_title=$pp_pic_holder.find(".ppt");$pp_title.width(t);titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom"));$pp_title=$pp_title.clone().appendTo(e("body")).css({position:"absolute",top:-1e4});titleHeight+=$pp_title.height();$pp_title.remove();l=n+detailsHeight;c=t;h=l+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height();p=t}function S(e){if(e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)){return"youtube"}else if(e.match(/vimeo\.com/i)){return"vimeo"}else if(e.match(/\b.mov\b/i)){return"quicktime"}else if(e.match(/\b.swf\b/i)){return"flash"}else if(e.match(/\biframe=true\b/i)){return"iframe"}else if(e.match(/\bajax=true\b/i)){return"ajax"}else if(e.match(/\bcustom=true\b/i)){return"custom"}else if(e.substr(0,1)=="#"){return"inline"}else{return"image"}}function x(){if(doresize&&typeof $pp_pic_holder!="undefined"){scroll_pos=T();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=d/2+scroll_pos["scrollTop"]-contentHeight/2;if(projectedTop<0)projectedTop=0;if(contentHeight>d)return;$pp_pic_holder.css({top:projectedTop,left:v/2+scroll_pos["scrollLeft"]-contentwidth/2})}}function T(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}}}function N(){d=e(window).height(),v=e(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height(e(document).height()).width(v)}function C(){if(isSet&&settings.overlay_gallery&&S(pp_images[set_position])=="image"){itemWidth=52+5;navWidth=settings.theme=="facebook"||settings.theme=="pp_default"?50:30;itemsPerPage=Math.floor((a["containerWidth"]-100-navWidth)/itemWidth);itemsPerPage=itemsPerPage"}toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find("#pp_full_res").after(toInject);$pp_gallery=e(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li");$pp_gallery.find(".pp_arrow_next").click(function(){e.prettyPhoto.changeGalleryPage("next");e.prettyPhoto.stopSlideshow();return false});$pp_gallery.find(".pp_arrow_previous").click(function(){e.prettyPhoto.changeGalleryPage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()});itemWidth=52+5;$pp_gallery_li.each(function(t){e(this).find("a").click(function(){e.prettyPhoto.changePage(t);e.prettyPhoto.stopSlideshow();return false})})}if(settings.slideshow){$pp_pic_holder.find(".pp_nav").prepend('Play');$pp_pic_holder.find(".pp_nav .pp_play").click(function(){e.prettyPhoto.startSlideshow();return false})}$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme);$pp_overlay.css({opacity:0,height:e(document).height(),width:e(window).width()}).bind("click",function(){if(!settings.modal)e.prettyPhoto.close()});e("a.pp_close").bind("click",function(){e.prettyPhoto.close();return false});if(settings.allow_expand){e("a.pp_expand").bind("click",function(t){if(e(this).hasClass("pp_expand")){e(this).removeClass("pp_expand").addClass("pp_contract");doresize=false}else{e(this).removeClass("pp_contract").addClass("pp_expand");doresize=true}y(function(){e.prettyPhoto.open()});return false})}$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){e.prettyPhoto.changePage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){e.prettyPhoto.changePage("next");e.prettyPhoto.stopSlideshow();return false});x()}s=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:false,opacity:.8,show_title:true,allow_resize:true,allow_expand:true,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:false,wmode:"opaque",autoplay:true,modal:false,deeplinking:true,overlay_gallery:true,overlay_gallery_max:30,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},ie6_fallback:true,markup:'
    ย 
    ',gallery_markup:'',image_markup:'',flash_markup:'',quicktime_markup:'',iframe_markup:'',inline_markup:'
    {content}
    ',custom_markup:"",social_tools:''},s);var o=this,u=false,a,f,l,c,h,p,d=e(window).height(),v=e(window).width(),m;doresize=true,scroll_pos=T();e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){x();N()});if(s.keyboard_shortcuts){e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(t){if(typeof $pp_pic_holder!="undefined"){if($pp_pic_holder.is(":visible")){switch(t.keyCode){case 37:e.prettyPhoto.changePage("previous");t.preventDefault();break;case 39:e.prettyPhoto.changePage("next");t.preventDefault();break;case 27:if(!settings.modal)e.prettyPhoto.close();t.preventDefault();break}}}})}e.prettyPhoto.initialize=function(){settings=s;if(settings.theme=="pp_default")settings.horizontal_padding=16;theRel=e(this).attr(settings.hook);galleryRegExp=/\[(?:.*)\]/;isSet=galleryRegExp.exec(theRel)?true:false;pp_images=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("href")}):e.makeArray(e(this).attr("href"));pp_titles=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):""}):e.makeArray(e(this).find("img").attr("alt"));pp_descriptions=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("title")?e(t).attr("title"):""}):e.makeArray(e(this).attr("title"));if(pp_images.length>settings.overlay_gallery_max)settings.overlay_gallery=false;set_position=jQuery.inArray(e(this).attr("href"),pp_images);rel_index=isSet?set_position:e("a["+settings.hook+"^='"+theRel+"']").index(e(this));k(this);if(settings.allow_resize)e(window).bind("scroll.prettyphoto",function(){x()});e.prettyPhoto.open();return false};e.prettyPhoto.open=function(t){if(typeof settings=="undefined"){settings=s;pp_images=e.makeArray(arguments[0]);pp_titles=arguments[1]?e.makeArray(arguments[1]):e.makeArray("");pp_descriptions=arguments[2]?e.makeArray(arguments[2]):e.makeArray("");isSet=pp_images.length>1?true:false;set_position=arguments[3]?arguments[3]:0;k(t.target)}if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden");b(e(pp_images).size());e(".pp_loaderIcon").show();if(settings.deeplinking)n();if(settings.social_tools){facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href));$pp_pic_holder.find(".pp_social").html(facebook_like_link)}if($ppt.is(":hidden"))$ppt.css("opacity",0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+e(pp_images).size());if(typeof pp_descriptions[set_position]!="undefined"&&pp_descriptions[set_position]!=""){$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position]))}else{$pp_pic_holder.find(".pp_description").hide()}movie_width=parseFloat(i("width",pp_images[set_position]))?i("width",pp_images[set_position]):settings.default_width.toString();movie_height=parseFloat(i("height",pp_images[set_position]))?i("height",pp_images[set_position]):settings.default_height.toString();u=false;if(movie_height.indexOf("%")!=-1){movie_height=parseFloat(e(window).height()*parseFloat(movie_height)/100-150);u=true}if(movie_width.indexOf("%")!=-1){movie_width=parseFloat(e(window).width()*parseFloat(movie_width)/100-150);u=true}$pp_pic_holder.fadeIn(function(){settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined"?$ppt.html(unescape(pp_titles[set_position])):$ppt.html("ย ");imgPreloader="";skipInjection=false;switch(S(pp_images[set_position])){case"image":imgPreloader=new Image;nextImage=new Image;if(isSet&&set_position0)movie_id=movie_id.substr(0,movie_id.indexOf("?"));if(movie_id.indexOf("&")>0)movie_id=movie_id.substr(0,movie_id.indexOf("&"))}movie="http://www.youtube.com/embed/"+movie_id;i("rel",pp_images[set_position])?movie+="?rel="+i("rel",pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":a=w(movie_width,movie_height);movie_id=pp_images[set_position];var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;var n=movie_id.match(t);movie="http://player.vimeo.com/video/"+n[3]+"?title=0&byline=0&portrait=0";if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=a["width"]+"/embed/?moog_width="+a["width"];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,a["height"]).replace(/{path}/g,movie);break;case"quicktime":a=w(movie_width,movie_height);a["height"]+=15;a["contentHeight"]+=15;a["containerHeight"]+=15;toInject=settings.quicktime_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":a=w(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf("?"));toInject=settings.flash_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":a=w(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1);toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{path}/g,frame_url);break;case"ajax":doresize=false;a=w(movie_width,movie_height);doresize=true;skipInjection=true;e.get(pp_images[set_position],function(e){toInject=settings.inline_markup.replace(/{content}/g,e);$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()});break;case"custom":a=w(movie_width,movie_height);toInject=settings.custom_markup;break;case"inline":myClone=e(pp_images[set_position]).clone().append('
    ').css({width:settings.default_width}).wrapInner('
    ').appendTo(e("body")).show();doresize=false;a=w(e(myClone).width(),e(myClone).height());doresize=true;e(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,e(pp_images[set_position]).html());break}if(!imgPreloader&&!skipInjection){$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()}});return false};e.prettyPhoto.changePage=function(t){currentGalleryPage=0;if(t=="previous"){set_position--;if(set_position<0)set_position=e(pp_images).size()-1}else if(t=="next"){set_position++;if(set_position>e(pp_images).size()-1)set_position=0}else{set_position=t}rel_index=set_position;if(!doresize)doresize=true;if(settings.allow_expand){e(".pp_contract").removeClass("pp_contract").addClass("pp_expand")}y(function(){e.prettyPhoto.open()})};e.prettyPhoto.changeGalleryPage=function(e){if(e=="next"){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0}else if(e=="previous"){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage}else{currentGalleryPage=e}slide_speed=e=="next"||e=="previous"?settings.animation_speed:0;slide_to=currentGalleryPage*itemsPerPage*itemWidth;$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)};e.prettyPhoto.startSlideshow=function(){if(typeof m=="undefined"){$pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){e.prettyPhoto.stopSlideshow();return false});m=setInterval(e.prettyPhoto.startSlideshow,settings.slideshow)}else{e.prettyPhoto.changePage("next")}};e.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){e.prettyPhoto.startSlideshow();return false});clearInterval(m);m=undefined};e.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;e.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find("object,embed").css("visibility","hidden");e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){e(this).remove()});$pp_overlay.fadeOut(settings.animation_speed,function(){if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible");e(this).remove();e(window).unbind("scroll.prettyphoto");r();settings.callback();doresize=true;f=false;delete settings})};if(!pp_alreadyInitialized&&t()){pp_alreadyInitialized=true;hashIndex=t();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf("/"));setTimeout(function(){e("a["+s.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)}return this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyPhoto.initialize)};})(jQuery);var pp_alreadyInitialized=false; !function(t,e){"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let i=this._events=this._events||{},s=i[t]=i[t]||[];return s.includes(e)||s.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this},e.off=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;let s=i.indexOf(e);return-1!=s&&i.splice(s,1),this},e.emitEvent=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;i=i.slice(0),e=e||[];let s=this._onceEvents&&this._onceEvents[t];for(let n of i){s&&s[n]&&(this.off(t,n),delete s[n]),n.apply(this,e)}return this},e.allOff=function(){return delete this._events,delete this._onceEvents,this},t})), function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,(function(t,e){let i=t.jQuery,s=t.console;function n(t,e,o){if(!(this instanceof n))return new n(t,e,o);let r=t;var h;("string"==typeof t&&(r=document.querySelectorAll(t)),r)?(this.elements=(h=r,Array.isArray(h)?h:"object"==typeof h&&"number"==typeof h.length?[...h]:[h]),this.options={},"function"==typeof e?o=e:Object.assign(this.options,e),o&&this.on("always",o),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):s.error(`Bad element for imagesLoaded ${r||t}`)}n.prototype=Object.create(e.prototype),n.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const o=[1,9,11];n.prototype.addElementImages=function(t){"IMG"===t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);let{nodeType:e}=t;if(!e||!o.includes(e))return;let i=t.querySelectorAll("img");for(let t of i)this.addImage(t);if("string"==typeof this.options.background){let e=t.querySelectorAll(this.options.background);for(let t of e)this.addElementBackgroundImages(t)}};const r=/url\((['"])?(.*?)\1\)/gi;function h(t){this.img=t}function d(t,e){this.url=t,this.element=e,this.img=new Image}return n.prototype.addElementBackgroundImages=function(t){let e=getComputedStyle(t);if(!e)return;let i=r.exec(e.backgroundImage);for(;null!==i;){let s=i&&i[2];s&&this.addBackground(s,t),i=r.exec(e.backgroundImage)}},n.prototype.addImage=function(t){let e=new h(t);this.images.push(e)},n.prototype.addBackground=function(t,e){let i=new d(t,e);this.images.push(i)},n.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let t=(t,e,i)=>{setTimeout((()=>{this.progress(t,e,i)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},n.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&s&&s.log(`progress: ${i}`,t,e)},n.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},h.prototype=Object.create(e.prototype),h.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},h.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},h.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:i}=this.img,s="PICTURE"===i.nodeName?i:this.img;this.emitEvent("progress",[this,s,e])},h.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype=Object.create(h.prototype),d.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},d.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},n.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(i=e,i.fn.imagesLoaded=function(t,e){return new n(this,t,e).jqDeferred.promise(i(this))})},n.makeJQueryPlugin(),n})); !function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;oe;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s=200==Math.round(t(o.width)),r.isBoxSizeOuter=s,i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;is?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i}); (function($){ "use strict"; $.fn.counterUp=function(options){ var settings=$.extend({ 'time': 400, 'delay': 10 }, options); return this.each(function(){ var $this=$(this); var $settings=settings; var counterUpper=function(){ var nums=[]; var divisions=$settings.time / $settings.delay; var num=$this.text(); var isComma=/[0-9]+,[0-9]+/.test(num); num=num.replace(/,/g, ''); var isInt=/^[0-9]+$/.test(num); var isFloat=/^[0-9]+\.[0-9]+$/.test(num); var decimalPlaces=isFloat ? (num.split('.')[1]||[]).length:0; for (var i=divisions; i >=1; i--){ var newNum=parseInt(num / divisions * i); if(isFloat){ newNum=parseFloat(num / divisions * i).toFixed(decimalPlaces); } if(isComma){ while (/(\d+)(\d{3})/.test(newNum.toString())){ newNum=newNum.toString().replace(/(\d+)(\d{3})/, '$1'+','+'$2'); }} nums.unshift(newNum); } $this.data('counterup-nums', nums); $this.text('0'); var f=function(){ $this.text($this.data('counterup-nums').shift()); if($this.data('counterup-nums').length){ setTimeout($this.data('counterup-func'), $settings.delay); }else{ delete $this.data('counterup-nums'); $this.data('counterup-nums', null); $this.data('counterup-func', null); }}; $this.data('counterup-func', f); setTimeout($this.data('counterup-func'), $settings.delay); }; $this.waypoint(counterUpper, { offset: '100%', triggerOnce: true }); }); };})(jQuery); !function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); ;(function($, window, document, undefined){ function Owl(element, options){ this.settings=null; this.options=$.extend({}, Owl.Defaults, options); this.$element=$(element); this._handlers={}; this._plugins={}; this._supress={}; this._current=null; this._speed=null; this._coordinates=[]; this._breakpoint=null; this._width=null; this._items=[]; this._clones=[]; this._mergers=[]; this._widths=[]; this._invalidated={}; this._pipe=[]; this._drag={ time: null, target: null, pointer: null, stage: { start: null, current: null }, direction: null }; this._states={ current: {}, tags: { 'initializing': [ 'busy' ], 'animating': [ 'busy' ], 'dragging': [ 'interacting' ] }}; $.each([ 'onResize', 'onThrottledResize' ], $.proxy(function(i, handler){ this._handlers[handler]=$.proxy(this[handler], this); }, this)); $.each(Owl.Plugins, $.proxy(function(key, plugin){ this._plugins[key.charAt(0).toLowerCase() + key.slice(1)] = new plugin(this); }, this)); $.each(Owl.Workers, $.proxy(function(priority, worker){ this._pipe.push({ 'filter': worker.filter, 'run': $.proxy(worker.run, this) }); }, this)); this.setup(); this.initialize(); } Owl.Defaults={ items: 3, loop: false, center: false, rewind: false, mouseDrag: true, touchDrag: true, pullDrag: true, freeDrag: false, margin: 0, stagePadding: 0, merge: false, mergeFit: true, autoWidth: false, startPosition: 0, rtl: false, smartSpeed: 250, fluidSpeed: false, dragEndSpeed: false, responsive: {}, responsiveRefreshRate: 200, responsiveBaseElement: window, fallbackEasing: 'swing', info: false, nestedItemSelector: false, itemElement: 'div', stageElement: 'div', refreshClass: 'owl-refresh', loadedClass: 'owl-loaded', loadingClass: 'owl-loading', rtlClass: 'owl-rtl', responsiveClass: 'owl-responsive', dragClass: 'owl-drag', itemClass: 'owl-item', stageClass: 'owl-stage', stageOuterClass: 'owl-stage-outer', grabClass: 'owl-grab' }; Owl.Width={ Default: 'default', Inner: 'inner', Outer: 'outer' }; Owl.Type={ Event: 'event', State: 'state' }; Owl.Plugins={}; Owl.Workers=[ { filter: [ 'width', 'settings' ], run: function(){ this._width=this.$element.width(); }}, { filter: [ 'width', 'items', 'settings' ], run: function(cache){ cache.current=this._items&&this._items[this.relative(this._current)]; }}, { filter: [ 'items', 'settings' ], run: function(){ this.$stage.children('.cloned').remove(); }}, { filter: [ 'width', 'items', 'settings' ], run: function(cache){ var margin=this.settings.margin||'', grid = !this.settings.autoWidth, rtl=this.settings.rtl, css={ 'width': 'auto', 'margin-left': rtl ? margin:'', 'margin-right': rtl ? '':margin }; !grid&&this.$stage.children().css(css); cache.css=css; }}, { filter: [ 'width', 'items', 'settings' ], run: function(cache){ var width=(this.width() / this.settings.items).toFixed(3) - this.settings.margin, merge=null, iterator=this._items.length, grid = !this.settings.autoWidth, widths=[]; cache.items={ merge: false, width: width }; while (iterator--){ merge=this._mergers[iterator]; merge=this.settings.mergeFit&&Math.min(merge, this.settings.items)||merge; cache.items.merge=merge > 1||cache.items.merge; widths[iterator] = !grid ? this._items[iterator].width():width * merge; } this._widths=widths; }}, { filter: [ 'items', 'settings' ], run: function(){ var clones=[], items=this._items, settings=this.settings, view=Math.max(settings.items * 2, 4), size=Math.ceil(items.length / 2) * 2, repeat=settings.loop&&items.length ? settings.rewind ? view:Math.max(view, size):0, append='', prepend=''; repeat /=2; while (repeat--){ clones.push(this.normalize(clones.length / 2, true)); append=append + items[clones[clones.length - 1]][0].outerHTML; clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true)); prepend=items[clones[clones.length - 1]][0].outerHTML + prepend; } this._clones=clones; $(append).addClass('cloned').appendTo(this.$stage); $(prepend).addClass('cloned').prependTo(this.$stage); }}, { filter: [ 'width', 'items', 'settings' ], run: function(){ var rtl=this.settings.rtl ? 1:-1, size=this._clones.length + this._items.length, iterator=-1, previous=0, current=0, coordinates=[]; while (++iterator < size){ previous=coordinates[iterator - 1]||0; current=this._widths[this.relative(iterator)] + this.settings.margin; coordinates.push(previous + current * rtl); } this._coordinates=coordinates; }}, { filter: [ 'width', 'items', 'settings' ], run: function(){ var padding=this.settings.stagePadding, coordinates=this._coordinates, css={ 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2, 'padding-left': padding||'', 'padding-right': padding||'' }; this.$stage.css(css); }}, { filter: [ 'width', 'items', 'settings' ], run: function(cache){ var iterator=this._coordinates.length, grid = !this.settings.autoWidth, items=this.$stage.children(); if(grid&&cache.items.merge){ while (iterator--){ cache.css.width=this._widths[this.relative(iterator)]; items.eq(iterator).css(cache.css); }}else if(grid){ cache.css.width=cache.items.width; items.css(cache.css); }} }, { filter: [ 'items' ], run: function(){ this._coordinates.length < 1&&this.$stage.removeAttr('style'); }}, { filter: [ 'width', 'items', 'settings' ], run: function(cache){ cache.current=cache.current ? this.$stage.children().index(cache.current):0; cache.current=Math.max(this.minimum(), Math.min(this.maximum(), cache.current)); this.reset(cache.current); }}, { filter: [ 'position' ], run: function(){ this.animate(this.coordinates(this._current)); }}, { filter: [ 'width', 'position', 'items', 'settings' ], run: function(){ var rtl=this.settings.rtl ? 1:-1, padding=this.settings.stagePadding * 2, begin=this.coordinates(this.current()) + padding, end=begin + this.width() * rtl, inner, outer, matches=[], i, n; for (i=0, n=this._coordinates.length; i < n; i++){ inner=this._coordinates[i - 1]||0; outer=Math.abs(this._coordinates[i]) + padding * rtl; if((this.op(inner, '<=', begin)&&(this.op(inner, '>', end))) || (this.op(outer, '<', begin)&&this.op(outer, '>', end))){ matches.push(i); }} this.$stage.children('.active').removeClass('active'); this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active'); if(this.settings.center){ this.$stage.children('.center').removeClass('center'); this.$stage.children().eq(this.current()).addClass('center'); }} } ]; Owl.prototype.initialize=function(){ this.enter('initializing'); this.trigger('initialize'); this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl); if(this.settings.autoWidth&&!this.is('pre-loading')){ var imgs, nestedSelector, width; imgs=this.$element.find('img'); nestedSelector=this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector:undefined; width=this.$element.children(nestedSelector).width(); if(imgs.length&&width <=0){ this.preloadAutoWidthImages(imgs); }} this.$element.addClass(this.options.loadingClass); this.$stage=$('<' + this.settings.stageElement + ' class="' + this.settings.stageClass + '"/>') .wrap('
    '); this.$element.append(this.$stage.parent()); this.replace(this.$element.children().not(this.$stage.parent())); if(this.$element.is(':visible')){ this.refresh(); }else{ this.invalidate('width'); } this.$element .removeClass(this.options.loadingClass) .addClass(this.options.loadedClass); this.registerEventHandlers(); this.leave('initializing'); this.trigger('initialized'); }; Owl.prototype.setup=function(){ var viewport=this.viewport(), overwrites=this.options.responsive, match=-1, settings=null; if(!overwrites){ settings=$.extend({}, this.options); }else{ $.each(overwrites, function(breakpoint){ if(breakpoint <=viewport&&breakpoint > match){ match=Number(breakpoint); }}); settings=$.extend({}, this.options, overwrites[match]); if(typeof settings.stagePadding==='function'){ settings.stagePadding=settings.stagePadding(); } delete settings.responsive; if(settings.responsiveClass){ this.$element.attr('class', this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match) ); }} this.trigger('change', { property: { name: 'settings', value: settings }}); this._breakpoint=match; this.settings=settings; this.invalidate('settings'); this.trigger('changed', { property: { name: 'settings', value: this.settings }}); }; Owl.prototype.optionsLogic=function(){ if(this.settings.autoWidth){ this.settings.stagePadding=false; this.settings.merge=false; }}; Owl.prototype.prepare=function(item){ var event=this.trigger('prepare', { content: item }); if(!event.data){ event.data=$('<' + this.settings.itemElement + '/>') .addClass(this.options.itemClass).append(item) } this.trigger('prepared', { content: event.data }); return event.data; }; Owl.prototype.update=function(){ var i=0, n=this._pipe.length, filter=$.proxy(function(p){ return this[p] }, this._invalidated), cache={}; while (i < n){ if(this._invalidated.all||$.grep(this._pipe[i].filter, filter).length > 0){ this._pipe[i].run(cache); } i++; } this._invalidated={}; !this.is('valid')&&this.enter('valid'); }; Owl.prototype.width=function(dimension){ dimension=dimension||Owl.Width.Default; switch (dimension){ case Owl.Width.Inner: case Owl.Width.Outer: return this._width; default: return this._width - this.settings.stagePadding * 2 + this.settings.margin; }}; Owl.prototype.refresh=function(){ this.enter('refreshing'); this.trigger('refresh'); this.setup(); this.optionsLogic(); this.$element.addClass(this.options.refreshClass); this.update(); this.$element.removeClass(this.options.refreshClass); this.leave('refreshing'); this.trigger('refreshed'); }; Owl.prototype.onThrottledResize=function(){ window.clearTimeout(this.resizeTimer); this.resizeTimer=window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate); }; Owl.prototype.onResize=function(){ if(!this._items.length){ return false; } if(this._width===this.$element.width()){ return false; } if(!this.$element.is(':visible')){ return false; } this.enter('resizing'); if(this.trigger('resize').isDefaultPrevented()){ this.leave('resizing'); return false; } this.invalidate('width'); this.refresh(); this.leave('resizing'); this.trigger('resized'); }; Owl.prototype.registerEventHandlers=function(){ if($.support.transition){ this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this)); } if(this.settings.responsive!==false){ this.on(window, 'resize', this._handlers.onThrottledResize); } if(this.settings.mouseDrag){ this.$element.addClass(this.options.dragClass); this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this)); this.$stage.on('dragstart.owl.core selectstart.owl.core', function(){ return false }); } if(this.settings.touchDrag){ this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this)); this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this)); }}; Owl.prototype.onDragStart=function(event){ var stage=null; if(event.which===3){ return; } if($.support.transform){ stage=this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(','); stage={ x: stage[stage.length===16 ? 12:4], y: stage[stage.length===16 ? 13:5] };}else{ stage=this.$stage.position(); stage={ x: this.settings.rtl ? stage.left + this.$stage.width() - this.width() + this.settings.margin : stage.left, y: stage.top };} if(this.is('animating')){ $.support.transform ? this.animate(stage.x):this.$stage.stop() this.invalidate('position'); } this.$element.toggleClass(this.options.grabClass, event.type==='mousedown'); this.speed(0); this._drag.time=new Date().getTime(); this._drag.target=$(event.target); this._drag.stage.start=stage; this._drag.stage.current=stage; this._drag.pointer=this.pointer(event); $(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this)); $(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event){ var delta=this.difference(this._drag.pointer, this.pointer(event)); $(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this)); if(Math.abs(delta.x) < Math.abs(delta.y)&&this.is('valid')){ return; } event.preventDefault(); this.enter('dragging'); this.trigger('drag'); }, this)); }; Owl.prototype.onDragMove=function(event){ var minimum=null, maximum=null, pull=null, delta=this.difference(this._drag.pointer, this.pointer(event)), stage=this.difference(this._drag.stage.start, delta); if(!this.is('dragging')){ return; } event.preventDefault(); if(this.settings.loop){ minimum=this.coordinates(this.minimum()); maximum=this.coordinates(this.maximum() + 1) - minimum; stage.x=(((stage.x - minimum) % maximum + maximum) % maximum) + minimum; }else{ minimum=this.settings.rtl ? this.coordinates(this.maximum()):this.coordinates(this.minimum()); maximum=this.settings.rtl ? this.coordinates(this.minimum()):this.coordinates(this.maximum()); pull=this.settings.pullDrag ? -1 * delta.x / 5:0; stage.x=Math.max(Math.min(stage.x, minimum + pull), maximum + pull); } this._drag.stage.current=stage; this.animate(stage.x); }; Owl.prototype.onDragEnd=function(event){ var delta=this.difference(this._drag.pointer, this.pointer(event)), stage=this._drag.stage.current, direction=delta.x > 0 ^ this.settings.rtl ? 'left':'right'; $(document).off('.owl.core'); this.$element.removeClass(this.options.grabClass); if(delta.x!==0&&this.is('dragging')||!this.is('valid')){ this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed); this.current(this.closest(stage.x, delta.x!==0 ? direction:this._drag.direction)); this.invalidate('position'); this.update(); this._drag.direction=direction; if(Math.abs(delta.x) > 3||new Date().getTime() - this._drag.time > 300){ this._drag.target.one('click.owl.core', function(){ return false; }); }} if(!this.is('dragging')){ return; } this.leave('dragging'); this.trigger('dragged'); }; Owl.prototype.closest=function(coordinate, direction){ var position=-1, pull=30, width=this.width(), coordinates=this.coordinates(); if(!this.settings.freeDrag){ $.each(coordinates, $.proxy(function(index, value){ if(direction==='left'&&coordinate > value - pull&&coordinate < value + pull){ position=index; }else if(direction==='right'&&coordinate > value - width - pull&&coordinate < value - width + pull){ position=index + 1; }else if(this.op(coordinate, '<', value) && this.op(coordinate, '>', coordinates[index + 1]||value - width)){ position=direction==='left' ? index + 1:index; } return position===-1; }, this)); } if(!this.settings.loop){ if(this.op(coordinate, '>', coordinates[this.minimum()])){ position=coordinate=this.minimum(); }else if(this.op(coordinate, '<', coordinates[this.maximum()])){ position=coordinate=this.maximum(); }} return position; }; Owl.prototype.animate=function(coordinate){ var animate=this.speed() > 0; this.is('animating')&&this.onTransitionEnd(); if(animate){ this.enter('animating'); this.trigger('translate'); } if($.support.transform3d&&$.support.transition){ this.$stage.css({ transform: 'translate3d(' + coordinate + 'px,0px,0px)', transition: (this.speed() / 1000) + 's' }); }else if(animate){ this.$stage.animate({ left: coordinate + 'px' }, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this)); }else{ this.$stage.css({ left: coordinate + 'px' }); }}; Owl.prototype.is=function(state){ return this._states.current[state]&&this._states.current[state] > 0; }; Owl.prototype.current=function(position){ if(position===undefined){ return this._current; } if(this._items.length===0){ return undefined; } position=this.normalize(position); if(this._current!==position){ var event=this.trigger('change', { property: { name: 'position', value: position }}); if(event.data!==undefined){ position=this.normalize(event.data); } this._current=position; this.invalidate('position'); this.trigger('changed', { property: { name: 'position', value: this._current }}); } return this._current; }; Owl.prototype.invalidate=function(part){ if($.type(part)==='string'){ this._invalidated[part]=true; this.is('valid')&&this.leave('valid'); } return $.map(this._invalidated, function(v, i){ return i }); }; Owl.prototype.reset=function(position){ position=this.normalize(position); if(position===undefined){ return; } this._speed=0; this._current=position; this.suppress([ 'translate', 'translated' ]); this.animate(this.coordinates(position)); this.release([ 'translate', 'translated' ]); }; Owl.prototype.normalize=function(position, relative){ var n=this._items.length, m=relative ? 0:this._clones.length; if(!this.isNumeric(position)||n < 1){ position=undefined; }else if(position < 0||position >=n + m){ position=((position - m / 2) % n + n) % n + m / 2; } return position; }; Owl.prototype.relative=function(position){ position -=this._clones.length / 2; return this.normalize(position, true); }; Owl.prototype.maximum=function(relative){ var settings=this.settings, maximum=this._coordinates.length, iterator, reciprocalItemsWidth, elementWidth; if(settings.loop){ maximum=this._clones.length / 2 + this._items.length - 1; }else if(settings.autoWidth||settings.merge){ iterator=this._items.length; reciprocalItemsWidth=this._items[--iterator].width(); elementWidth=this.$element.width(); while (iterator--){ reciprocalItemsWidth +=this._items[iterator].width() + this.settings.margin; if(reciprocalItemsWidth > elementWidth){ break; }} maximum=iterator + 1; }else if(settings.center){ maximum=this._items.length - 1; }else{ maximum=this._items.length - settings.items; } if(relative){ maximum -=this._clones.length / 2; } return Math.max(maximum, 0); }; Owl.prototype.minimum=function(relative){ return relative ? 0:this._clones.length / 2; }; Owl.prototype.items=function(position){ if(position===undefined){ return this._items.slice(); } position=this.normalize(position, true); return this._items[position]; }; Owl.prototype.mergers=function(position){ if(position===undefined){ return this._mergers.slice(); } position=this.normalize(position, true); return this._mergers[position]; }; Owl.prototype.clones=function(position){ var odd=this._clones.length / 2, even=odd + this._items.length, map=function(index){ return index % 2===0 ? even + index / 2:odd - (index + 1) / 2 }; if(position===undefined){ return $.map(this._clones, function(v, i){ return map(i) }); } return $.map(this._clones, function(v, i){ return v===position ? map(i):null }); }; Owl.prototype.speed=function(speed){ if(speed!==undefined){ this._speed=speed; } return this._speed; }; Owl.prototype.coordinates=function(position){ var multiplier=1, newPosition=position - 1, coordinate; if(position===undefined){ return $.map(this._coordinates, $.proxy(function(coordinate, index){ return this.coordinates(index); }, this)); } if(this.settings.center){ if(this.settings.rtl){ multiplier=-1; newPosition=position + 1; } coordinate=this._coordinates[position]; coordinate +=(this.width() - coordinate + (this._coordinates[newPosition]||0)) / 2 * multiplier; }else{ coordinate=this._coordinates[newPosition]||0; } coordinate=Math.ceil(coordinate); return coordinate; }; Owl.prototype.duration=function(from, to, factor){ if(factor===0){ return 0; } return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor||this.settings.smartSpeed)); }; Owl.prototype.to=function(position, speed){ var current=this.current(), revert=null, distance=position - this.relative(current), direction=(distance > 0) - (distance < 0), items=this._items.length, minimum=this.minimum(), maximum=this.maximum(); if(this.settings.loop){ if(!this.settings.rewind&&Math.abs(distance) > items / 2){ distance +=direction * -1 * items; } position=current + distance; revert=((position - minimum) % items + items) % items + minimum; if(revert!==position&&revert - distance <=maximum&&revert - distance > 0){ current=revert - distance; position=revert; this.reset(current); }}else if(this.settings.rewind){ maximum +=1; position=(position % maximum + maximum) % maximum; }else{ position=Math.max(minimum, Math.min(maximum, position)); } this.speed(this.duration(current, position, speed)); this.current(position); if(this.$element.is(':visible')){ this.update(); }}; Owl.prototype.next=function(speed){ speed=speed||false; this.to(this.relative(this.current()) + 1, speed); }; Owl.prototype.prev=function(speed){ speed=speed||false; this.to(this.relative(this.current()) - 1, speed); }; Owl.prototype.onTransitionEnd=function(event){ if(event!==undefined){ event.stopPropagation(); if((event.target||event.srcElement||event.originalTarget)!==this.$stage.get(0)){ return false; }} this.leave('animating'); this.trigger('translated'); }; Owl.prototype.viewport=function(){ var width; if(this.options.responsiveBaseElement!==window){ width=$(this.options.responsiveBaseElement).width(); }else if(window.innerWidth){ width=window.innerWidth; }else if(document.documentElement&&document.documentElement.clientWidth){ width=document.documentElement.clientWidth; }else{ throw 'Can not detect viewport width.'; } return width; }; Owl.prototype.replace=function(content){ this.$stage.empty(); this._items=[]; if(content){ content=(content instanceof jQuery) ? content:$(content); } if(this.settings.nestedItemSelector){ content=content.find('.' + this.settings.nestedItemSelector); } content.filter(function(){ return this.nodeType===1; }).each($.proxy(function(index, item){ item=this.prepare(item); this.$stage.append(item); this._items.push(item); this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1||1); }, this)); this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition:0); this.invalidate('items'); }; Owl.prototype.add=function(content, position){ var current=this.relative(this._current); position=position===undefined ? this._items.length:this.normalize(position, true); content=content instanceof jQuery ? content:$(content); this.trigger('add', { content: content, position: position }); content=this.prepare(content); if(this._items.length===0||position===this._items.length){ this._items.length===0&&this.$stage.append(content); this._items.length!==0&&this._items[position - 1].after(content); this._items.push(content); this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1||1); }else{ this._items[position].before(content); this._items.splice(position, 0, content); this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1||1); } this._items[current]&&this.reset(this._items[current].index()); this.invalidate('items'); this.trigger('added', { content: content, position: position }); }; Owl.prototype.remove=function(position){ position=this.normalize(position, true); if(position===undefined){ return; } this.trigger('remove', { content: this._items[position], position: position }); this._items[position].remove(); this._items.splice(position, 1); this._mergers.splice(position, 1); this.invalidate('items'); this.trigger('removed', { content: null, position: position }); }; Owl.prototype.preloadAutoWidthImages=function(images){ images.each($.proxy(function(i, element){ this.enter('pre-loading'); element=$(element); $(new Image()).one('load', $.proxy(function(e){ element.attr('src', e.target.src); element.css('opacity', 1); this.leave('pre-loading'); !this.is('pre-loading')&&!this.is('initializing')&&this.refresh(); }, this)).attr('src', element.attr('src')||element.attr('data-src')||element.attr('data-src-retina')); }, this)); }; Owl.prototype.destroy=function(){ this.$element.off('.owl.core'); this.$stage.off('.owl.core'); $(document).off('.owl.core'); if(this.settings.responsive!==false){ window.clearTimeout(this.resizeTimer); this.off(window, 'resize', this._handlers.onThrottledResize); } for (var i in this._plugins){ this._plugins[i].destroy(); } this.$stage.children('.cloned').remove(); this.$stage.unwrap(); this.$stage.children().contents().unwrap(); this.$stage.children().unwrap(); this.$element .removeClass(this.options.refreshClass) .removeClass(this.options.loadingClass) .removeClass(this.options.loadedClass) .removeClass(this.options.rtlClass) .removeClass(this.options.dragClass) .removeClass(this.options.grabClass) .attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), '')) .removeData('owl.carousel'); }; Owl.prototype.op=function(a, o, b){ var rtl=this.settings.rtl; switch (o){ case '<': return rtl ? a > b:a < b; case '>': return rtl ? a < b:a > b; case '>=': return rtl ? a <=b:a >=b; case '<=': return rtl ? a >=b:a <=b; default: break; }}; Owl.prototype.on=function(element, event, listener, capture){ if(element.addEventListener){ element.addEventListener(event, listener, capture); }else if(element.attachEvent){ element.attachEvent('on' + event, listener); }}; Owl.prototype.off=function(element, event, listener, capture){ if(element.removeEventListener){ element.removeEventListener(event, listener, capture); }else if(element.detachEvent){ element.detachEvent('on' + event, listener); }}; Owl.prototype.trigger=function(name, data, namespace, state, enter){ var status={ item: { count: this._items.length, index: this.current() }}, handler=$.camelCase($.grep([ 'on', name, namespace ], function(v){ return v }) .join('-').toLowerCase() ), event=$.Event([ name, 'owl', namespace||'carousel' ].join('.').toLowerCase(), $.extend({ relatedTarget: this }, status, data) ); if(!this._supress[name]){ $.each(this._plugins, function(name, plugin){ if(plugin.onTrigger){ plugin.onTrigger(event); }}); this.register({ type: Owl.Type.Event, name: name }); this.$element.trigger(event); if(this.settings&&typeof this.settings[handler]==='function'){ this.settings[handler].call(this, event); }} return event; }; Owl.prototype.enter=function(name){ $.each([ name ].concat(this._states.tags[name]||[]), $.proxy(function(i, name){ if(this._states.current[name]===undefined){ this._states.current[name]=0; } this._states.current[name]++; }, this)); }; Owl.prototype.leave=function(name){ $.each([ name ].concat(this._states.tags[name]||[]), $.proxy(function(i, name){ this._states.current[name]--; }, this)); }; Owl.prototype.register=function(object){ if(object.type===Owl.Type.Event){ if(!$.event.special[object.name]){ $.event.special[object.name]={};} if(!$.event.special[object.name].owl){ var _default=$.event.special[object.name]._default; $.event.special[object.name]._default=function(e){ if(_default&&_default.apply&&(!e.namespace||e.namespace.indexOf('owl')===-1)){ return _default.apply(this, arguments); } return e.namespace&&e.namespace.indexOf('owl') > -1; }; $.event.special[object.name].owl=true; }}else if(object.type===Owl.Type.State){ if(!this._states.tags[object.name]){ this._states.tags[object.name]=object.tags; }else{ this._states.tags[object.name]=this._states.tags[object.name].concat(object.tags); } this._states.tags[object.name]=$.grep(this._states.tags[object.name], $.proxy(function(tag, i){ return $.inArray(tag, this._states.tags[object.name])===i; }, this)); }}; Owl.prototype.suppress=function(events){ $.each(events, $.proxy(function(index, event){ this._supress[event]=true; }, this)); }; Owl.prototype.release=function(events){ $.each(events, $.proxy(function(index, event){ delete this._supress[event]; }, this)); }; Owl.prototype.pointer=function(event){ var result={ x: null, y: null }; event=event.originalEvent||event||window.event; event=event.touches&&event.touches.length ? event.touches[0]:event.changedTouches&&event.changedTouches.length ? event.changedTouches[0]:event; if(event.pageX){ result.x=event.pageX; result.y=event.pageY; }else{ result.x=event.clientX; result.y=event.clientY; } return result; }; Owl.prototype.isNumeric=function(number){ return !isNaN(parseFloat(number)); }; Owl.prototype.difference=function(first, second){ return { x: first.x - second.x, y: first.y - second.y };}; $.fn.owlCarousel=function(option){ var args=Array.prototype.slice.call(arguments, 1); return this.each(function(){ var $this=$(this), data=$this.data('owl.carousel'); if(!data){ data=new Owl(this, typeof option=='object'&&option); $this.data('owl.carousel', data); $.each([ 'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove' ], function(i, event){ data.register({ type: Owl.Type.Event, name: event }); data.$element.on(event + '.owl.carousel.core', $.proxy(function(e){ if(e.namespace&&e.relatedTarget!==this){ this.suppress([ event ]); data[event].apply(this, [].slice.call(arguments, 1)); this.release([ event ]); }}, data)); }); } if(typeof option=='string'&&option.charAt(0)!=='_'){ data[option].apply(data, args); }}); }; $.fn.owlCarousel.Constructor=Owl; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var AutoRefresh=function(carousel){ this._core=carousel; this._interval=null; this._visible=null; this._handlers={ 'initialized.owl.carousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.autoRefresh){ this.watch(); }}, this) }; this._core.options=$.extend({}, AutoRefresh.Defaults, this._core.options); this._core.$element.on(this._handlers); }; AutoRefresh.Defaults={ autoRefresh: true, autoRefreshInterval: 500 }; AutoRefresh.prototype.watch=function(){ if(this._interval){ return; } this._visible=this._core.$element.is(':visible'); this._interval=window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval); }; AutoRefresh.prototype.refresh=function(){ if(this._core.$element.is(':visible')===this._visible){ return; } this._visible = !this._visible; this._core.$element.toggleClass('owl-hidden', !this._visible); this._visible&&(this._core.invalidate('width')&&this._core.refresh()); }; AutoRefresh.prototype.destroy=function(){ var handler, property; window.clearInterval(this._interval); for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.AutoRefresh=AutoRefresh; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var Lazy=function(carousel){ this._core=carousel; this._loaded=[]; this._handlers={ 'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e){ if(!e.namespace){ return; } if(!this._core.settings||!this._core.settings.lazyLoad){ return; } if((e.property&&e.property.name=='position')||e.type=='initialized'){ var settings=this._core.settings, n=(settings.center&&Math.ceil(settings.items / 2)||settings.items), i=((settings.center&&n * -1)||0), position=(e.property&&e.property.value!==undefined ? e.property.value:this._core.current()) + i, clones=this._core.clones().length, load=$.proxy(function(i, v){ this.load(v) }, this); while (i++ < n){ this.load(clones / 2 + this._core.relative(position)); clones&&$.each(this._core.clones(this._core.relative(position)), load); position++; }} }, this) }; this._core.options=$.extend({}, Lazy.Defaults, this._core.options); this._core.$element.on(this._handlers); }; Lazy.Defaults={ lazyLoad: false }; Lazy.prototype.load=function(position){ var $item=this._core.$stage.children().eq(position), $elements=$item&&$item.find('.owl-lazy'); if(!$elements||$.inArray($item.get(0), this._loaded) > -1){ return; } $elements.each($.proxy(function(index, element){ var $element=$(element), image, url=(window.devicePixelRatio > 1&&$element.attr('data-src-retina'))||$element.attr('data-src'); this._core.trigger('load', { element: $element, url: url }, 'lazy'); if($element.is('img')){ $element.one('load.owl.lazy', $.proxy(function(){ $element.css('opacity', 1); this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); }, this)).attr('src', url); }else{ image=new Image(); image.onload=$.proxy(function(){ $element.css({ 'background-image': 'url(' + url + ')', 'opacity': '1' }); this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); }, this); image.src=url; }}, this)); this._loaded.push($item.get(0)); }; Lazy.prototype.destroy=function(){ var handler, property; for (handler in this.handlers){ this._core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.Lazy=Lazy; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var AutoHeight=function(carousel){ this._core=carousel; this._handlers={ 'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.autoHeight){ this.update(); }}, this), 'changed.owl.carousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.autoHeight&&e.property.name=='position'){ this.update(); }}, this), 'loaded.owl.lazy': $.proxy(function(e){ if(e.namespace&&this._core.settings.autoHeight && e.element.closest('.' + this._core.settings.itemClass).index()===this._core.current()){ this.update(); }}, this) }; this._core.options=$.extend({}, AutoHeight.Defaults, this._core.options); this._core.$element.on(this._handlers); }; AutoHeight.Defaults={ autoHeight: false, autoHeightClass: 'owl-height' }; AutoHeight.prototype.update=function(){ var start=this._core._current, end=start + this._core.settings.items, visible=this._core.$stage.children().toArray().slice(start, end), heights=[], maxheight=0; $.each(visible, function(index, item){ heights.push($(item).height()); }); maxheight=Math.max.apply(null, heights); this._core.$stage.parent() .height(maxheight) .addClass(this._core.settings.autoHeightClass); }; AutoHeight.prototype.destroy=function(){ var handler, property; for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.AutoHeight=AutoHeight; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var Video=function(carousel){ this._core=carousel; this._videos={}; this._playing=null; this._handlers={ 'initialized.owl.carousel': $.proxy(function(e){ if(e.namespace){ this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] }); }}, this), 'resize.owl.carousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.video&&this.isInFullScreen()){ e.preventDefault(); }}, this), 'refreshed.owl.carousel': $.proxy(function(e){ if(e.namespace&&this._core.is('resizing')){ this._core.$stage.find('.cloned .owl-video-frame').remove(); }}, this), 'changed.owl.carousel': $.proxy(function(e){ if(e.namespace&&e.property.name==='position'&&this._playing){ this.stop(); }}, this), 'prepared.owl.carousel': $.proxy(function(e){ if(!e.namespace){ return; } var $element=$(e.content).find('.owl-video'); if($element.length){ $element.css('display', 'none'); this.fetch($element, $(e.content)); }}, this) }; this._core.options=$.extend({}, Video.Defaults, this._core.options); this._core.$element.on(this._handlers); this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e){ this.play(e); }, this)); }; Video.Defaults={ video: false, videoHeight: false, videoWidth: false }; Video.prototype.fetch=function(target, item){ var type=(function(){ if(target.attr('data-vimeo-id')){ return 'vimeo'; }else if(target.attr('data-vzaar-id')){ return 'vzaar' }else{ return 'youtube'; }})(), id=target.attr('data-vimeo-id')||target.attr('data-youtube-id')||target.attr('data-vzaar-id'), width=target.attr('data-width')||this._core.settings.videoWidth, height=target.attr('data-height')||this._core.settings.videoHeight, url=target.attr('href'); if(url){ id=url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/); if(id[3].indexOf('youtu') > -1){ type='youtube'; }else if(id[3].indexOf('vimeo') > -1){ type='vimeo'; }else if(id[3].indexOf('vzaar') > -1){ type='vzaar'; }else{ throw new Error('Video URL not supported.'); } id=id[6]; }else{ throw new Error('Missing video URL.'); } this._videos[url]={ type: type, id: id, width: width, height: height }; item.attr('data-video', url); this.thumbnail(target, this._videos[url]); }; Video.prototype.thumbnail=function(target, video){ var tnLink, icon, path, dimensions=video.width&&video.height ? 'style="width:' + video.width + 'px;height:' + video.height + 'px;"':'', customTn=target.find('img'), srcType='src', lazyClass='', settings=this._core.settings, create=function(path){ icon='
    '; if(settings.lazyLoad){ tnLink='
    '; }else{ tnLink='
    '; } target.after(tnLink); target.after(icon); }; target.wrap('
    '); if(this._core.settings.lazyLoad){ srcType='data-src'; lazyClass='owl-lazy'; } if(customTn.length){ create(customTn.attr(srcType)); customTn.remove(); return false; } if(video.type==='youtube'){ path="//img.youtube.com/vi/" + video.id + "/hqdefault.jpg"; create(path); }else if(video.type==='vimeo'){ $.ajax({ type: 'GET', url: '//vimeo.com/api/v2/video/' + video.id + '.json', jsonp: 'callback', dataType: 'jsonp', success: function(data){ path=data[0].thumbnail_large; create(path); }}); }else if(video.type==='vzaar'){ $.ajax({ type: 'GET', url: '//vzaar.com/api/videos/' + video.id + '.json', jsonp: 'callback', dataType: 'jsonp', success: function(data){ path=data.framegrab_url; create(path); }}); }}; Video.prototype.stop=function(){ this._core.trigger('stop', null, 'video'); this._playing.find('.owl-video-frame').remove(); this._playing.removeClass('owl-video-playing'); this._playing=null; this._core.leave('playing'); this._core.trigger('stopped', null, 'video'); }; Video.prototype.play=function(event){ var target=$(event.target), item=target.closest('.' + this._core.settings.itemClass), video=this._videos[item.attr('data-video')], width=video.width||'100%', height=video.height||this._core.$stage.height(), html; if(this._playing){ return; } this._core.enter('playing'); this._core.trigger('play', null, 'video'); item=this._core.items(this._core.relative(item.index())); this._core.reset(item.index()); if(video.type==='youtube'){ html=''; }else if(video.type==='vimeo'){ html=''; }else if(video.type==='vzaar'){ html=''; } $('
    ' + html + '
    ').insertAfter(item.find('.owl-video')); this._playing=item.addClass('owl-video-playing'); }; Video.prototype.isInFullScreen=function(){ var element=document.fullscreenElement||document.mozFullScreenElement || document.webkitFullscreenElement; return element&&$(element).parent().hasClass('owl-video-frame'); }; Video.prototype.destroy=function(){ var handler, property; this._core.$element.off('click.owl.video'); for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.Video=Video; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var Animate=function(scope){ this.core=scope; this.core.options=$.extend({}, Animate.Defaults, this.core.options); this.swapping=true; this.previous=undefined; this.next=undefined; this.handlers={ 'change.owl.carousel': $.proxy(function(e){ if(e.namespace&&e.property.name=='position'){ this.previous=this.core.current(); this.next=e.property.value; }}, this), 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e){ if(e.namespace){ this.swapping=e.type=='translated'; }}, this), 'translate.owl.carousel': $.proxy(function(e){ if(e.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)){ this.swap(); }}, this) }; this.core.$element.on(this.handlers); }; Animate.Defaults={ animateOut: false, animateIn: false }; Animate.prototype.swap=function(){ if(this.core.settings.items!==1){ return; } if(!$.support.animation||!$.support.transition){ return; } this.core.speed(0); var left, clear=$.proxy(this.clear, this), previous=this.core.$stage.children().eq(this.previous), next=this.core.$stage.children().eq(this.next), incoming=this.core.settings.animateIn, outgoing=this.core.settings.animateOut; if(this.core.current()===this.previous){ return; } if(outgoing){ left=this.core.coordinates(this.previous) - this.core.coordinates(this.next); previous.one($.support.animation.end, clear) .css({ 'left': left + 'px' }) .addClass('animated owl-animated-out') .addClass(outgoing); } if(incoming){ next.one($.support.animation.end, clear) .addClass('animated owl-animated-in') .addClass(incoming); }}; Animate.prototype.clear=function(e){ $(e.target).css({ 'left': '' }) .removeClass('animated owl-animated-out owl-animated-in') .removeClass(this.core.settings.animateIn) .removeClass(this.core.settings.animateOut); this.core.onTransitionEnd(); }; Animate.prototype.destroy=function(){ var handler, property; for (handler in this.handlers){ this.core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.Animate=Animate; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var Autoplay=function(carousel){ this._core=carousel; this._timeout=null; this._paused=false; this._handlers={ 'changed.owl.carousel': $.proxy(function(e){ if(e.namespace&&e.property.name==='settings'){ if(this._core.settings.autoplay){ this.play(); }else{ this.stop(); }}else if(e.namespace&&e.property.name==='position'){ if(this._core.settings.autoplay){ this._setAutoPlayInterval(); }} }, this), 'initialized.owl.carousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.autoplay){ this.play(); }}, this), 'play.owl.autoplay': $.proxy(function(e, t, s){ if(e.namespace){ this.play(t, s); }}, this), 'stop.owl.autoplay': $.proxy(function(e){ if(e.namespace){ this.stop(); }}, this), 'mouseover.owl.autoplay': $.proxy(function(){ if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){ this.pause(); }}, this), 'mouseleave.owl.autoplay': $.proxy(function(){ if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){ this.play(); }}, this), 'touchstart.owl.core': $.proxy(function(){ if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){ this.pause(); }}, this), 'touchend.owl.core': $.proxy(function(){ if(this._core.settings.autoplayHoverPause){ this.play(); }}, this) }; this._core.$element.on(this._handlers); this._core.options=$.extend({}, Autoplay.Defaults, this._core.options); }; Autoplay.Defaults={ autoplay: false, autoplayTimeout: 5000, autoplayHoverPause: false, autoplaySpeed: false }; Autoplay.prototype.play=function(timeout, speed){ this._paused=false; if(this._core.is('rotating')){ return; } this._core.enter('rotating'); this._setAutoPlayInterval(); }; Autoplay.prototype._getNextTimeout=function(timeout, speed){ if(this._timeout){ window.clearTimeout(this._timeout); } return window.setTimeout($.proxy(function(){ if(this._paused||this._core.is('busy')||this._core.is('interacting')||document.hidden){ return; } this._core.next(speed||this._core.settings.autoplaySpeed); }, this), timeout||this._core.settings.autoplayTimeout); }; Autoplay.prototype._setAutoPlayInterval=function(){ this._timeout=this._getNextTimeout(); }; Autoplay.prototype.stop=function(){ if(!this._core.is('rotating')){ return; } window.clearTimeout(this._timeout); this._core.leave('rotating'); }; Autoplay.prototype.pause=function(){ if(!this._core.is('rotating')){ return; } this._paused=true; }; Autoplay.prototype.destroy=function(){ var handler, property; this.stop(); for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.autoplay=Autoplay; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ 'use strict'; var Navigation=function(carousel){ this._core=carousel; this._initialized=false; this._pages=[]; this._controls={}; this._templates=[]; this.$element=this._core.$element; this._overrides={ next: this._core.next, prev: this._core.prev, to: this._core.to }; this._handlers={ 'prepared.owl.carousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.dotsData){ this._templates.push('
    ' + $(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '
    '); }}, this), 'added.owl.carousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.dotsData){ this._templates.splice(e.position, 0, this._templates.pop()); }}, this), 'remove.owl.carousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.dotsData){ this._templates.splice(e.position, 1); }}, this), 'changed.owl.carousel': $.proxy(function(e){ if(e.namespace&&e.property.name=='position'){ this.draw(); }}, this), 'initialized.owl.carousel': $.proxy(function(e){ if(e.namespace&&!this._initialized){ this._core.trigger('initialize', null, 'navigation'); this.initialize(); this.update(); this.draw(); this._initialized=true; this._core.trigger('initialized', null, 'navigation'); }}, this), 'refreshed.owl.carousel': $.proxy(function(e){ if(e.namespace&&this._initialized){ this._core.trigger('refresh', null, 'navigation'); this.update(); this.draw(); this._core.trigger('refreshed', null, 'navigation'); }}, this) }; this._core.options=$.extend({}, Navigation.Defaults, this._core.options); this.$element.on(this._handlers); }; Navigation.Defaults={ nav: false, navText: [ 'prev', 'next' ], navSpeed: false, navElement: 'div', navContainer: false, navContainerClass: 'owl-nav', navClass: [ 'owl-prev', 'owl-next' ], slideBy: 1, dotClass: 'owl-dot', dotsClass: 'owl-dots', dots: true, dotsEach: false, dotsData: false, dotsSpeed: false, dotsContainer: false }; Navigation.prototype.initialize=function(){ var override, settings=this._core.settings; this._controls.$relative=(settings.navContainer ? $(settings.navContainer) : $('
    ').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled'); this._controls.$previous=$('<' + settings.navElement + '>') .addClass(settings.navClass[0]) .html(settings.navText[0]) .prependTo(this._controls.$relative) .on('click', $.proxy(function(e){ this.prev(settings.navSpeed); }, this)); this._controls.$next=$('<' + settings.navElement + '>') .addClass(settings.navClass[1]) .html(settings.navText[1]) .appendTo(this._controls.$relative) .on('click', $.proxy(function(e){ this.next(settings.navSpeed); }, this)); if(!settings.dotsData){ this._templates=[ $('
    ') .addClass(settings.dotClass) .append($('')) .prop('outerHTML') ]; } this._controls.$absolute=(settings.dotsContainer ? $(settings.dotsContainer) : $('
    ').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled'); this._controls.$absolute.on('click', 'div', $.proxy(function(e){ var index=$(e.target).parent().is(this._controls.$absolute) ? $(e.target).index():$(e.target).parent().index(); e.preventDefault(); this.to(index, settings.dotsSpeed); }, this)); for (override in this._overrides){ this._core[override]=$.proxy(this[override], this); }}; Navigation.prototype.destroy=function(){ var handler, control, property, override; for (handler in this._handlers){ this.$element.off(handler, this._handlers[handler]); } for (control in this._controls){ this._controls[control].remove(); } for (override in this.overides){ this._core[override]=this._overrides[override]; } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; Navigation.prototype.update=function(){ var i, j, k, lower=this._core.clones().length / 2, upper=lower + this._core.items().length, maximum=this._core.maximum(true), settings=this._core.settings, size=settings.center||settings.autoWidth||settings.dotsData ? 1:settings.dotsEach||settings.items; if(settings.slideBy!=='page'){ settings.slideBy=Math.min(settings.slideBy, settings.items); } if(settings.dots||settings.slideBy=='page'){ this._pages=[]; for (i=lower, j=0, k=0; i < upper; i++){ if(j >=size||j===0){ this._pages.push({ start: Math.min(maximum, i - lower), end: i - lower + size - 1 }); if(Math.min(maximum, i - lower)===maximum){ break; } j=0, ++k; } j +=this._core.mergers(this._core.relative(i)); }} }; Navigation.prototype.draw=function(){ var difference, settings=this._core.settings, disabled=this._core.items().length <=settings.items, index=this._core.relative(this._core.current()), loop=settings.loop||settings.rewind; this._controls.$relative.toggleClass('disabled', !settings.nav||disabled); if(settings.nav){ this._controls.$previous.toggleClass('disabled', !loop&&index <=this._core.minimum(true)); this._controls.$next.toggleClass('disabled', !loop&&index >=this._core.maximum(true)); } this._controls.$absolute.toggleClass('disabled', !settings.dots||disabled); if(settings.dots){ difference=this._pages.length - this._controls.$absolute.children().length; if(settings.dotsData&&difference!==0){ this._controls.$absolute.html(this._templates.join('')); }else if(difference > 0){ this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0])); }else if(difference < 0){ this._controls.$absolute.children().slice(difference).remove(); } this._controls.$absolute.find('.active').removeClass('active'); this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active'); }}; Navigation.prototype.onTrigger=function(event){ var settings=this._core.settings; event.page={ index: $.inArray(this.current(), this._pages), count: this._pages.length, size: settings&&(settings.center||settings.autoWidth||settings.dotsData ? 1:settings.dotsEach||settings.items) };}; Navigation.prototype.current=function(){ var current=this._core.relative(this._core.current()); return $.grep(this._pages, $.proxy(function(page, index){ return page.start <=current&&page.end >=current; }, this)).pop(); }; Navigation.prototype.getPosition=function(successor){ var position, length, settings=this._core.settings; if(settings.slideBy=='page'){ position=$.inArray(this.current(), this._pages); length=this._pages.length; successor ? ++position:--position; position=this._pages[((position % length) + length) % length].start; }else{ position=this._core.relative(this._core.current()); length=this._core.items().length; successor ? position +=settings.slideBy:position -=settings.slideBy; } return position; }; Navigation.prototype.next=function(speed){ $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed); }; Navigation.prototype.prev=function(speed){ $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed); }; Navigation.prototype.to=function(position, speed, standard){ var length; if(!standard&&this._pages.length){ length=this._pages.length; $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed); }else{ $.proxy(this._overrides.to, this._core)(position, speed); }}; $.fn.owlCarousel.Constructor.Plugins.Navigation=Navigation; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ 'use strict'; var Hash=function(carousel){ this._core=carousel; this._hashes={}; this.$element=this._core.$element; this._handlers={ 'initialized.owl.carousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.startPosition==='URLHash'){ $(window).trigger('hashchange.owl.navigation'); }}, this), 'prepared.owl.carousel': $.proxy(function(e){ if(e.namespace){ var hash=$(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash'); if(!hash){ return; } this._hashes[hash]=e.content; }}, this), 'changed.owl.carousel': $.proxy(function(e){ if(e.namespace&&e.property.name==='position'){ var current=this._core.items(this._core.relative(this._core.current())), hash=$.map(this._hashes, function(item, hash){ return item===current ? hash:null; }).join(); if(!hash||window.location.hash.slice(1)===hash){ return; } window.location.hash=hash; }}, this) }; this._core.options=$.extend({}, Hash.Defaults, this._core.options); this.$element.on(this._handlers); $(window).on('hashchange.owl.navigation', $.proxy(function(e){ var hash=window.location.hash.substring(1), items=this._core.$stage.children(), position=this._hashes[hash]&&items.index(this._hashes[hash]); if(position===undefined||position===this._core.current()){ return; } this._core.to(this._core.relative(position), false, true); }, this)); }; Hash.Defaults={ URLhashListener: false }; Hash.prototype.destroy=function(){ var handler, property; $(window).off('hashchange.owl.navigation'); for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.Hash=Hash; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var style=$('').get(0).style, prefixes='Webkit Moz O ms'.split(' '), events={ transition: { end: { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd', transition: 'transitionend' }}, animation: { end: { WebkitAnimation: 'webkitAnimationEnd', MozAnimation: 'animationend', OAnimation: 'oAnimationEnd', animation: 'animationend' }} }, tests={ csstransforms: function(){ return !!test('transform'); }, csstransforms3d: function(){ return !!test('perspective'); }, csstransitions: function(){ return !!test('transition'); }, cssanimations: function(){ return !!test('animation'); }}; function test(property, prefixed){ var result=false, upper=property.charAt(0).toUpperCase() + property.slice(1); $.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property){ if(style[property]!==undefined){ result=prefixed ? property:true; return false; }}); return result; } function prefixed(property){ return test(property, true); } if(tests.csstransitions()){ $.support.transition=new String(prefixed('transition')) $.support.transition.end=events.transition.end[ $.support.transition ]; } if(tests.cssanimations()){ $.support.animation=new String(prefixed('animation')) $.support.animation.end=events.animation.end[ $.support.animation ]; } if(tests.csstransforms()){ $.support.transform=new String(prefixed('transform')); $.support.transform3d=tests.csstransforms3d(); }})(window.Zepto||window.jQuery, window, document); (function($){ function IsEmail($email){ var emailReg=/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; return emailReg.test($email); } jQuery("form.contact-form #submit").click(function(){ var obj=jQuery(this).parents(".contact-form"); var Name=obj.find("input#name").val(); var Email=obj.find("input#email").val(); var Message=obj.find("textarea#message").val(); var sendto=obj.find("input#sendto").val(); var notice=obj.find(".noticefailed"); if(!notice.length){ obj.append('
    '); notice=obj.find(".noticefailed"); } notice.text(""); if(Name===''){ notice.html(onetone_params.i18n.i3); return false; } if(!IsEmail(Email)){ notice.html(onetone_params.i18n.i2); return false; } if(Message===''){ notice.html(onetone_params.i18n.i4); return false; } notice.html(""); notice.append("loading"); jQuery.ajax({ type:"POST", dataType:"json", url:onetone_params.ajaxurl, data:{'Name':Name,'Email':Email,'Message':Message,'sendto':sendto,'action':'onetone_contact'}, success:function(data){ if(data.error==0){ notice.addClass("noticesuccess").removeClass("noticefailed"); obj.find(".noticesuccess").html(data.msg); }else{ notice.html(data.msg); } jQuery('.loading').remove();obj[0].reset(); }, error:function(){ notice.html("Error."); obj.find('.loading').remove(); }}); }); $(".site-navbar,.home-navbar").click(function(){ $(".top-nav").toggle(); }); $('.top-nav ul li').hover(function(){ $(this).find('ul:first').slideDown(100); $(this).addClass("hover"); },function(){ $(this).find('ul').css('display','none'); $(this).removeClass("hover"); }); $('.top-nav li ul li:has(ul)').find("a:first").append(" ยป "); var windowWidth=$(window).width(); if(windowWidth > 939){ if($(".site-main .sidebar").height() > $(".site-main .main-content").height()){ $(".site-main .main-content").css("height",($(".site-main .sidebar").height()+140)+"px"); }}else{ $(".site-main .main-content").css("height","auto"); } $(window).resize(function(){ var windowWidth=$(window).width(); if(windowWidth > 939){ if($(".site-main .sidebar").height() > $(".site-main .main-content").height()){ $(".site-main .main-content").css("height",($(".site-main .sidebar").height()+140)+"px"); }}else{ $(".site-main .main-content").css("height","auto"); } if(windowWidth > 919){ $(".top-nav").show(); }else{ $(".top-nav").hide(); }}); })(jQuery); jQuery(document).ready(function($){ var adminbarHeight=function(){ var stickyTop; if($("body.admin-bar").length){ if($(window).width() < 765){ stickyTop=46; }else{ stickyTop=32; }}else{ stickyTop=0; } return stickyTop; } var is_rtl=false; var stickyTop; if(onetone_params.is_rtl=='1') is_rtl=true; stickyTop=adminbarHeight(); if($("section.homepage-slider .item").length >1){ if(onetone_params.slide_fullheight=='1'&&$(window).width() > 1024){ $('section.homepage-slider').height($(window).height()-stickyTop); $('section.homepage-slider .item').height($(window).height()-stickyTop); } $("#onetone-owl-slider").owlCarousel({ nav:onetone_params.slider_control=='1'?true:false, dots:onetone_params.slider_pagination=='1'?true:false, slideSpeed:300, items:1, autoplay:onetone_params.slide_autoplay=='1'?true:false, margin:0, rtl: is_rtl, loop:true, paginationSpeed:400, singleItem:true, autoplayTimeout:parseInt(onetone_params.slideSpeed) }); } if($(".onetone-related-posts").length){ $(".onetone-related-posts").owlCarousel({ navigation:false, pagination: false, loop:false, items:4, slideSpeed:300, paginationSpeed:400, margin:15, rtl: is_rtl, singleItem:false, responsive:{ 320:{ items:1, nav:false }, 768:{ items:2, nav:false }, 992:{ items:3, nav:false }, 1200:{ items:4, nav:false, }} }); } if($("section.homepage-slider .item").length==1){ $("section.homepage-slider .owl-carousel").show(); } $(".site-nav-toggle").click(function(){ $(".site-nav").toggle(); $('.main-header') .toggleClass('menu-expanded'); $('.fxd-header') .toggleClass('menu-expanded'); }); $('.menu-item-has-children > ul').before(''); $(document).on('click', "span.menu-item-toggle",function(e){ $(this).siblings('ul').toggle(); $(this).closest('li').toggleClass('opened'); }); if(window.devicePixelRatio > 1){ if($('.normal_logo').length&&$('.retina_logo').length){ $('.normal_logo').hide(); $('.retina_logo').show(); } $('.page-title-bar').addClass('page-title-bar-retina'); } var myPlayer; $(function (){ myPlayer=$("#onetone-youtube-video").YTPlayer(); $("#onetone-youtube-video").on("YTPReady",function(e){ $(".video-section,.video-section section").css('background', 'none'); $(".video-section").parent('section.section').css('background', 'none'); $("#video-controls").show(); }); }); $(window).scroll(function(){ if($(window).scrollTop() > 200){ $("#back-to-top").fadeIn(200); }else{ $("#back-to-top").fadeOut(200); }}); $('#back-to-top, .back-to-top').click(function(){ $('html, body').animate({ scrollTop:0 }, '800'); return false; }); $('.onetone-parallax').parallax("50%", 0.1); if($('.parallax-scrolling').length){ $('.parallax-scrolling').parallax({speed:0.15}); } $(window).scroll(function(){ var scrollTop=$(window).scrollTop(); if($('div.fxd-header').length){ if(scrollTop > 0){ $('.fxd-header').css({'top':stickyTop}).show(); $('header').addClass('fixed-header'); }else{ $('.fxd-header').hide(); $('header').removeClass('fixed-header'); }} }); $(document).on('click', "a.scroll,.onetone-nav a[href^='#'],.onetone-menuitem a[href^='#']",function(e){ if($(window).width() <=919){ $(".site-nav") .css('display', 'none'); $('.main-header') .removeClass('menu-expanded'); $('.fxd-header') .removeClass('menu-expanded'); } var selectorHeight=0; if($('.fxd-header').length) var selectorHeight=$('.fxd-header').outerHeight(); var scrollTop=$(window).scrollTop(); e.preventDefault(); var id=$(this).attr('href'); if(typeof $(id).offset()!=='undefined'){ var goTo=$(id).offset().top - selectorHeight - stickyTop + 1; $("html, body").animate({ scrollTop: goTo }, 1000); }}); $('header .site-nav ul,ul.onetone-dots').onePageNav({filter: 'a[href^="#"]',scrollThreshold:0.3}); $("div.page a[href^='#'],div.post a[href^='#'],div.home-wrapper a[href^='#'],.banner-scroll a[href^='#'],a.banner-scroll[href^='#']").on('click', function(e){ var selectorHeight=$('header').height(); var scrollTop=$(window).scrollTop(); e.preventDefault(); var id=$(this).attr('href'); if(typeof $(id).offset()!=='undefined'){ var goTo=$(id).offset().top - selectorHeight; $("html, body").animate({ scrollTop: goTo }, 1000); }}); if(onetone_params.enable_image_lightbox==='1') $("a[rel^='onetone-portfolio-image']").prettyPhoto(); var gallery_counter=1; $('.gallery') .each(function(index, el){ $(this).find('.gallery-item a') .attr('rel', 'prettyPhoto[pp_gal' + gallery_counter + ']'); gallery_counter++; }); $(".gallery .gallery-item a").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true}); if($(window).width() <1200){ newPercentage=(($(window).width() / 1200) * 100) + "%"; $(".home-banner .heading-inner").css({"font-size": newPercentage}); } $(window).on("resize", function (){ if($(window).width() <1200){ newPercentage=(($(window).width() / 1200) * 100) + "%"; $(".home-banner .heading-inner").css({"font-size": newPercentage}); }else{ $(".home-banner .heading-inner").css({"font-size": "100%"}); }}); var win_height=$(window).height(); $("section.fullheight").each(function(){ var section_height=$(this).height(); $(this).css({'height':section_height,'min-height':win_height}); }); $('.onetone-animated').each(function(){ if($(this).data('imageanimation')==="yes"){ $(this).find("img,i.fa").css("visibility","hidden"); }else{ $(this).css("visibility","hidden"); }}); if($('.onetone-animated').length&&$(window).height() > $('.onetone-animated:first').offset().top){ onetone_animation($('.onetone-animated:first')); } var mageeCounter=function(){ $('.magee-counter-box').each(function(){ if($(this).find('.counter-num').text()==='0'){ mageeCounter(); }else{ setTimeout(function (){ $(this).find('.counter-num').counterUp({ delay: 10, time: 10 }); }, 500); }}); } mageeCounter(); }); function onetone_animation(e){ e.css({'visibility':'visible'}); e.find("img,i.fa").css({'visibility':'visible'}); var animation_type=e.data('animationtype'); var animation_duration=e.data('animationduration'); var image_animation=e.data('imageanimation'); if(image_animation==="yes"){ e.find("img,i.fa").addClass("animated "+animation_type); if(animation_duration){ e.find("img,i.fa").css('-moz-animation-duration', animation_duration+'s'); e.find("img,i.fa").css('-webkit-animation-duration', animation_duration+'s'); e.find("img,i.fa").css('-ms-animation-duration', animation_duration+'s'); e.find("img,i.fa").css('-o-animation-duration', animation_duration+'s'); e.find("img,i.fa").css('animation-duration', animation_duration+'s'); }}else{ e.addClass("animated "+animation_type); if(animation_duration){ e.css('-moz-animation-duration', animation_duration+'s'); e.css('-webkit-animation-duration', animation_duration+'s'); e.css('-ms-animation-duration', animation_duration+'s'); e.css('-o-animation-duration', animation_duration+'s'); e.css('animation-duration', animation_duration+'s'); }} } var animated=false; jQuery(window).scroll(function (){ if(jQuery().waypoint&&animated==false){ jQuery('.onetone-animated').waypoint(function(){ onetone_animation(jQuery(this.element)); },{ triggerOnce: true, offset: '90%' }); } animated=true; }); (function(e,h,l,c){e.fn.sonar=function(o,n){if(typeof o==="boolean"){n=o;o=c}return e.sonar(this[0],o,n)};var f=l.body,a="scrollin",m="scrollout",b=function(r,n,t){if(r){f||(f=l.body);var s=r,u=0,v=f.offsetHeight,o=h.innerHeight||l.documentElement.clientHeight||f.clientHeight||0,q=l.documentElement.scrollTop||h.pageYOffset||f.scrollTop||0,p=r.offsetHeight||0;if(!r.sonarElemTop||r.sonarBodyHeight!==v){if(s.offsetParent){do{u+=s.offsetTop}while(s=s.offsetParent)}r.sonarElemTop=u;r.sonarBodyHeight=v}n=n===c?0:n;return(!(r.sonarElemTop+(t?0:p)q+o+n))}},d={},j=0,i=function(){setTimeout(function(){var s,o,t,q,p,r,n;for(t in d){o=d[t];for(r=0,n=o.length;r